#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofill


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofill


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can autofill do this? CluelessGuy vs. Windows Excel Discussion (Misc queries) 2 February 8th 07 10:29 PM
Autofill paulinoluciano Excel Worksheet Functions 8 December 28th 05 06:00 PM
Autofill? Amateur Excel Discussion (Misc queries) 3 September 9th 05 07:46 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM


All times are GMT +1. The time now is 03:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"