Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

cell pointer movement

  Asked By: Darcy    Date: Dec 19    Category: MS Office    Views: 707
  

I am working on moving the cell
pointer from one location to another via code. Here
is what I am doing. The sendkeys does not work.

range("a2").select
tmpcnt = 4

Do While tmpcnt < linecnt
SendKeys "{down}"
tmpcnt = tmpcnt + 1
Loop

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Konrada Schmidt     Answered On: Dec 19

The Offset method would suit you better for this operation.

Instead of the Do loop

Use

ActiveCell.offset(linecnt-tempcnt,0).activate

 
Answer #2    Answered By: Amy Brown     Answered On: Dec 19

Thanks so much for the line of code. Works great. Do you have
another great resolution for this problem? I have to multiple each
cell together. The cell  range will vary depending on how much data
the user enters. For example,

c1 10
c2 20
c3 20

formula c1*c2*c3

 
Answer #3    Answered By: Mandy Harvey     Answered On: Dec 19

You would need to write a function which

1) identified the range to be multiplied

(probably select C1 and then extend selection end down)

2) stepped through the range multiplying each cell.value as it went

3) returned the final product

I do not have the time to do this just now. How about you try it and let us
know if you have problems.

The function would need to be in a Module not in the sheet code. Then you
just refer to it by entering its name (with the following parentheses) in a
cell.

 
Answer #4    Answered By: Kawthar Malik     Answered On: Dec 19

I guess the real question is, is there a way to
determine what cell  you are in? I can move through
the cells but don't know how to get the cell address.

 
Answer #5    Answered By: Komal Malik     Answered On: Dec 19

You might mean

ActiveCell.Address

 
Didn't find what you were looking for? Find more on cell pointer movement Or get search suggestion and latest updates.




Tagged: