View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joe MacPherson Joe MacPherson is offline
external usenet poster
 
Posts: 1
Default Help with "Autofill" Destination Range

Hi all...
I'm new to VBA and need help in defining an "fillRange"
variable to help populate the "Autofill" Destination
property...
I've recorded a macro to perform the following:
From within a defined template initiate a macro to
Open an existing data file
Copy a selected range from the data file
Open the original template window (containing a number of
static formulas)
Paste the copy selection into the appropriate cell area of
the original template
Copy the static formulas using the "Autofill" function
Save the template as a new file...

The difficulty that I have is when I record macro, with
the Autofill function, using a set file, the
required "Destination Range" property value populates the
macro with the set range for that specific file. When I
use the macro on another data file with a differing number
of rows, the macro only works for the range as defined
from the first recording... I'm looking for a way to
create a variable where I can determine the "fillRange"
and use the variable as the "Destination Range" property
value ... any help?