Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
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
How do I convert an integer variable to a string variable? dumbass Excel Programming 2 May 21st 04 07:34 PM
Filling an array with integer variable Erche DP Excel Programming 1 May 13th 04 04:14 PM
Is variable an integer? Otto Moehrbach[_6_] Excel Programming 7 February 6th 04 04:31 PM
OutlineLevel and Integer Variable issue jurgenC![_2_] Excel Programming 2 January 30th 04 10:32 PM
Use of integer variable for sizing of matrix Cor Steeghs Excel Programming 2 August 8th 03 12:56 PM


All times are GMT +1. The time now is 11:03 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"