replacing a range with a variable?

  • Thread starter Thread starter Kenny
  • Start date Start date
K

Kenny

I was wanting to allow the user to specify a cell or range from an inpu
box on a form. I then wanted to use that information to specify wher
to start an autofill statement.
example

12/1/2003 (user input DATE would be the label)
1/1/2004 (' ' PATTERN ' 'l)
A1 (' ' STARTING CELL ' ')

code...

....
Range(mycell:mycell+1).AutoFill ActiveCell Range(mycell:lastCell)
xlFillFormats And xlFillSeries
....

I basicly want to replace the ...Range(*"A1:B1"*)....with
variable(s).

Thanks for any help..
 
use th eapplication InputBox, not the VB one, as this
allows you to specify the input type as a range - see
Help on InputBox


Dim rRange As Range
Set rRange = Application.InputBox("Select Target", "Get
Range", , , , , , 8)

8 is the Range type

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----

I was wanting to allow the user to specify a cell or range from an input
box on a form. I then wanted to use that information to specify where
to start an autofill statement.
example

12/1/2003 (user input DATE would be the label)
1/1/2004 (' ' PATTERN ' 'l)
A1 (' ' STARTING CELL ' ')

code...

....
Range(mycell:mycell+1).AutoFill ActiveCell Range (mycell:lastCell),
xlFillFormats And xlFillSeries
....

I basicly want to replace the ...Range (*"A1:B1"*)....with a
variable(s).

Thanks for any help...


------------------------------------------------

~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by
step guide to creating financial statements
 
Back
Top