Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All I have this piece of code. With this code I pick up the lastcolumn wit data in my sheet. What I now have to do is to give them month headings My code does this, but I need it to do more. I need it to skip a colum after every month. Below the code is an example of what I mean. Code ------------------- 'Fill in the month names lastcol = Cells(2, Columns.Count).End(xlToLeft).Column For i = 6 To lastcol For j = 1 To 1 Step 3 With Cells((j), (i)) .FormulaR1C1 = "January" .AutoFill Destination:=.Resize(, 2), Type:=xlFillDefault End With Next Nex ------------------- Example of what it should do: After January skip one column, afte february skip one column and so forth. Code ------------------- January February March Group Qty Value Qty Value Qty Value Bracelet 3 5.00 4 8.00 0 0.00 Ring 3 9.00 0 0.00 2 6.00 Ear rings 4 6.00 5 7.00 0 0.00 ------------------- Your help would be very appreciated. Kind Regard -- popp ----------------------------------------------------------------------- poppy's Profile: http://www.excelforum.com/member.php...fo&userid=1145 View this thread: http://www.excelforum.com/showthread.php?threadid=27559 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Range("A1").Value = "January" Range("A3").Value = "February" Range("A5:D5").Select Selection.AutoFill Destination:=Range("A5:I5") Type:=xlFillDefault Range("A5:I5").Select This will give you the spaces that you need in between, then you ca just generalize it if you need more than one year -- ehnt ----------------------------------------------------------------------- ehntd's Profile: http://www.excelforum.com/member.php...fo&userid=1586 View this thread: http://www.excelforum.com/showthread.php?threadid=27559 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can autofill do this? | Excel Discussion (Misc queries) | |||
Autofill | Excel Worksheet Functions | |||
Autofill? | Excel Discussion (Misc queries) | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
Q. Autofill question: Can I autofill alpha characters like I can numbers? | Excel Programming |