View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Variable Range in Macro not working.

The syntax you have should work (not the way i would do it but it should
work). The only thing I would add is that the variable values can not be 0
and must be less than 65,536... To that end you should be using long and not
integer as integer ends at 32k... If it was me I would be more inclined to do
something like...

Range(cells(fila, "A"), cells(ultimafila, "F")).Select

--
HTH...

Jim Thomlinson


"Nicolas" wrote:

Hi all,
I´m trying to select a range by using 2 integer variables and I get
the following Error msg
----------------------------------------------------
Run-time error '1004':

Application-defined or object-defined error
----------------------------------------------------

The sitax is as follows:

Range("A" & fila & ":" & "F" & ultimafila).Select

Should i type it in a different way ?
All suggestions welcome.
BR.
NICOLAS