selecting adjacent cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have searched help for the proper usage of cell commands but have not been
able to identify anything that allows me to select a cell, and by means of a
macro, select the adjacent cell and invoke an insertion macro I created.
It's the selection of the adjacent cell that is driving me crazy. On a macro
level scale of 1 to 10, with 1 being beginner, I am probably a two. I can
create some macros but nothing fancy. Thanks in advance for your help.

Tom M
 
You don't usually need to select a cell to work with it.

Option Explicit
sub testme()
dim myCell as range
set mycell = activesheet.range("b99") '<-- how do you find the cell to start

mycell.offset(0,1).select
'.offset(x,y) means go x rows (up or down or 0)
and y columns (left or right or 0)

.....your code
end sub
 
Thanks Chip. But all this does is move the cursor. Maybe it would help if I
provide more information. I have a lengthy list that I process daily. I
have 9 columns of data and have to match 2 of the rows to a third row. I
created a macro that inserts cells depending on how many rows I select. I
have to highlight or select the two columns I need to add cells to. This is
in liew of using the right click, insert, rows etc. The macro works well,
but it can still be improved on. What I would like to do is just leave my
cell pointer in one column and have a macro select the adjacent column to the
right (including the cell where my pointer is) and then insert cells. I hope
this is clearer. Think you can make it work?

Thanks

Tom M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top