Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - use variable integer as text
Dear Colleagues,
can somebody help me to find a solution how to use a varible integer in a macro as a part of text string? I have in my macro a varible X which contains a figure representing the number of rows in a spreadsheet. This amount is different in differnt workbooks. For example now it is X = 50. Now I need to incorporate this variable to a range declaration. For example: Range("D2:D50").select Here I need to have the figure 50 to be replaced by the variable X. Thanks a lot for your help. Drahos. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - use variable integer as text
Hi Draho,
Use Range("D2:D" & x ).select Thanks Xcelion "Drahos" wrote: Dear Colleagues, can somebody help me to find a solution how to use a varible integer in a macro as a part of text string? I have in my macro a varible X which contains a figure representing the number of rows in a spreadsheet. This amount is different in differnt workbooks. For example now it is X = 50. Now I need to incorporate this variable to a range declaration. For example: Range("D2:D50").select Here I need to have the figure 50 to be replaced by the variable X. Thanks a lot for your help. Drahos. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - use variable integer as text
Hi Xcelion,
thanks a lot. Simple and working. I have supposed that there should be a simple and elegant solution. I would like to ask you one more question. Looking to to the Modules in my PERSONAL.xls I see a lot of them. Something about 60. Looking into these Modules I see almost all of them are empty. I suppose they were created on the base of macro recording. Is it possible to remove all empty Modules? I suppose there should be the same number of Modules as I have the number of macros in my PERSONAL.xls (listed in the list of macros). If possible to delete them will they be automatically renumerated? I mean from Module1 to Module11 for example. I very appreciate your help. Drahos. "Xcelion" wrote: Hi Draho, Use Range("D2:D" & x ).select Thanks Xcelion "Drahos" wrote: Dear Colleagues, can somebody help me to find a solution how to use a varible integer in a macro as a part of text string? I have in my macro a varible X which contains a figure representing the number of rows in a spreadsheet. This amount is different in differnt workbooks. For example now it is X = 50. Now I need to incorporate this variable to a range declaration. For example: Range("D2:D50").select Here I need to have the figure 50 to be replaced by the variable X. Thanks a lot for your help. Drahos. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I convert an integer variable to a string variable? | Excel Programming | |||
Filling an array with integer variable | Excel Programming | |||
Is variable an integer? | Excel Programming | |||
OutlineLevel and Integer Variable issue | Excel Programming | |||
Use of integer variable for sizing of matrix | Excel Programming |