View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
steve steve is offline
external usenet poster
 
Posts: 576
Default VBA Cell row-column numbers to variable

Joe,

Don't recommend using R1 & C1 since they could represent cell addresses.

crow = Activecell.Row
ccol = Activecell.Column

steve

"Joe" wrote in message
...
In VBA, I need code that will let met set a variable equal
to the current cell in the Excel spreadsheet's row number
and set a second variable equal to the current cells
column number. i.e. if cell B3 is picked in the
spreadsheet and I run the macro I want the VBA code to set
variable R1 = 3 and set variable C1 = 2 since cell B3 is
picked. Your help is appreciated.