View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Robert Christie[_3_] Robert Christie[_3_] is offline
external usenet poster
 
Posts: 117
Default macro to insert pair of formulae in x number of rows -URGENT!!

Sorry Marika

i really don't understand what you are trying to do.
Where are the formulas to be placed?
Along side the inserted data only?
Where do they start and finish?
Do they stop at the start of the existing data?
What is the data layout, are both new and old 5 columns wide?
Where are the blank rows between the old and new data?
Aussie Bob C.

"marika1981" wrote:

Dear Bob,

Thanks SO much for your input - I really appreciate it!! The code you
offered ALMOST did the trick, but there's still one problem: it autofills all
the way down the table until the absolute last row. I'm trying to get it to
autofill down through the last blank row (basically the same number of rows
that were inserted in the previous step).

So, in a nutshell, the code needs to be adjusted so it autofills only
through the blank cells to the first cell of text in the column, not the
last. Any ideas???

Thanks again SO very much!

Marika :)


"Robert Christie" wrote:

Hi Marika

Try this if data in Column A does not have blank cells in it

Sub FillDown()

Range("F2:G2").AutoFill Destination:=Range("F2:G" &
Range("A1000").End(xlUp).Row)

End Sub

Watch out for word wrap above should be one line
A1000 can be changed to A10000 or 65000.
HTH

Regards,
Aussie Bob C.

"marika1981" wrote:

I've created a simple macro using "Insert Copied Cells" that copies and
pastes x number of rows of data at the top of an existing table of data. In
the table, there are five columns of data pasted in, and then two columns on
the right in which I add a pair of simple formulae (the same two formulae
repeated downwards in all rows).

I'd like these to appear automatically (via a macro) into the newly inserted
x number of rows (without knowing the value of x) after pasting in the data
in the first five columns.

Any ideas??? Is there a way to autofill down until you hit a non-blank cell
(I can insert the two formulae in the cells above the paste area)? or a way
to tell a macro to highlight downwards until it reaches a non-blank cell?

Thank you so much!!

Marika :)