View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Need help wiht a macro for autofill rows

I put different formulas in each cell in H2:L2 and ran the macro.

The formulas in each column adjusted when I copied them to the group of 22 rows.

If you put your formulas in H2:L2, then select H2:L2 and edit|copy.
Then select H2:H23 and do Edit|Paste, what happens?

I didn't touch M2:R2. It wasn't mentioned before.

klafert wrote:

I kind of understand but not clearly. But on the column k2 is the only one
with the same formula. H2-J2 has different data and L2 has different data.
M2-R2 has the heading only. Once I get everything copied and pulled from the
other spreadsheet. Then I will use vlookup and extract from another
spreadsheet, but that will come over clean. Isnt here an autofill macro - You
now how u use the Fill Down command or whatever works. I can send you my
spreadsheet if it will make it clearer. Virus Free have virust software as
good as it works - Norton. Thanks.

"Dave Peterson" wrote:

Actually, this line:

myFormulaRng.Copy _
Destination:=.Cells(iRow, "H").Resize(HowManyPerGroup - 1)

copied that first row (2) with had the formulas to 22 rows all at once.

If you have calculation set to manual, then try calculating.



klafert wrote:

Oh and the last filled row of the spreadsheet is A10914-r10914. What you did
almost work but it copied all the same data in each row which is
understandable considering I said I was copying the same formula all the way
down, but skipping a linel - Sorry for being as clear as mud - Does this help
or change things until then I am copying and pasting, possible trying to
adjust the macro you wrote, if I can? Help!!

"klafert" wrote:

I should have said the 1st row A1.L1 is a header row - Starting with row a2 I
copy 22 rows, want to skip one row and copy 22 more rows and skip again etc.

"Dave Peterson" wrote:

And just add, I'd delete up the blank rows. Those blank rows really mess things
up when you're filtering, doing pivottables, creating charts, or sorting.

You may want to consider just doubling the row height to make it look nicer when
printed.

klafert wrote:

I have a spreadsheet that has 10915 lines. I am copying the same formula
from row 2 - columns H2..L2 to the next 21 rows then there will be one blank
row and I will copy the same columns for the next 21 rows - blank row again
and so on.

Example:

I highlight row 2 (column H2-L2) Fill down H2:L2 to h23:L23 then I have one
blank row and then I would copy H2-L2 thru H23-l23 to h25-L46 - Hope that is
clear enough for somebody to understand if not let me know.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson