Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Cell row-column numbers to variable

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
autofill variable lenght column w/ sequential numbers using VBA Billyruben Excel Discussion (Misc queries) 2 November 28th 08 01:29 AM
Cell reference with variable column mjones Excel Worksheet Functions 4 April 25th 08 12:39 AM
How a cell can be addressed with variable file-column? thegreeneyes Excel Discussion (Misc queries) 1 February 5th 08 02:33 PM
reference cell value from fixed column with variable row bob z Excel Discussion (Misc queries) 0 May 23rd 05 11:30 PM
how to create a variable column in cell reference Sampson Excel Worksheet Functions 3 February 21st 05 10:13 PM


All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"