View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AKphidelt AKphidelt is offline
external usenet poster
 
Posts: 461
Default copying rows to all possible records during a macro

When it comes to dynamic ranges like this I usually get a count of the number
of rows and then paste the formula down to that row... for example

Dim x as Integer

x = Range("A1").End(xlDown).Row

Range("B1").Formula = "Yourformula"
Range("B1").Copy
Range("B2:B" & x).PasteSpecial


"childofthe1980s" wrote:

Hello:

I have created a macro that, among other things, copies a formula from the
first row of records to the remaining rows of records in the spreadsheet of
data that I exported to Excel from an accounting application.

Now, is there a way (perhaps in VBA Editor) that I can tell the macro to
copy this formula to any and all possible records that are exported to Excel?
I can see where, if there are more or less records exported during the next
export, that some of the programming can be "lost".

childofthe1980s