A simple one I hope:
I have a macro that is formatting a load of data, within the macro - i am trying to assign the row number of the current cell to a variable, for use at the end of each loop.
Any help would be ghreat - thanks.
A simple one I hope:
I have a macro that is formatting a load of data, within the macro - i am trying to assign the row number of the current cell to a variable, for use at the end of each loop.
Any help would be ghreat - thanks.
Neil07979, can you post your code ?
(be sure to use CODE tags - use the # button)
You rarely need to use ActiveCell in code... and you may find you can format ranges in batches to speed up your code execution...
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Not much to it at the moment - its the first thing I need to do:
ThanksPlease Login or Register to view this content.
OK, in which case let me re-phrase it: what are you trying to achieve ?
All I need to do is be able to assign the row number of the current cell to a variable.
So I have declared the variable as RowNumber, selected cell A8 - and I want 8 to be stored.
This will then be used further through the loop, to reference back and paste other information to a certain cell within Row 8.
Thanks
OK, I don't have the time to spend trying to elucidate further on why you're unlikely to need this and you seem unwilling to outline what is you're trying to do with the entire routine so to answer your question
or if you're selecting a specific cell (eg A8) just set the value to the row which you know already given you're using a predefined selectionPlease Login or Register to view this content.
Note: use Long type for Row Variables - Integer is susceptible to error ... moreover Integers are converted to Long under the hood in 32-bit VBA so there really is no value in using the Integer type anyway.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks