If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Cell value wont set?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-08, 09:17
Trinsan Trinsan is offline
Registered User
 
Join Date: Oct 2005
Posts: 168
Cell value wont set?

Okay, so I've done this qyute a few times in the past, but haven't touched code for a few months.

Code:
    x = Selection.Row
    y = Selection.Column
    
    With ActiveSheet
        .Cells(x, (y + 1)).Value = "kfhdfksh"
        ' GIDrs!Medlemsskab
    End With
Its should be pretty obvious what I wish to. Basically I grab the coordinates of the current cell, and want to add a value to the cell next to it. Initially I am just testing with dummy data, but will be fetching data out of an ADO recordset.

Apparently I'm referencing the cell wrong, but can't seem to figure out in which way?

Thanks for any (really noobish) help,

Trin
__________________
IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....
Reply With Quote
  #2 (permalink)  
Old 01-23-08, 06:55
karthic_85 karthic_85 is offline
Registered User
 
Join Date: Dec 2007
Posts: 37
This code works in a way that if i edit any cell then next cell wll be populated with dummy data
what is the problem,can u pls brief?
__________________
Meyyappan
Reply With Quote
  #3 (permalink)  
Old 01-23-08, 09:28
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
It should work, but I don't think you need the parentheses around y+1.

Code:
With ActiveSheet
        .Cells(x, y + 1).Value = "kfhdfksh"
        ' GIDrs!Medlemsskab
    End With
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On