Macro - use variable integer as text

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

Guest

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.
 
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.
 

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