Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Problem,
I have a problem with a spreadsheet that comes down the page in "steps".(If you had a blank sheet of paper turn it landscape and draw a line from the bottom left hand corner to the top right hand corner and just look at the area above the line - that's the shape of the spreadsheet.) Each month I have to add a new step to those already there. Each step is 4 cols wide and 6 rows down, so for example this month I would highlight cells A100:D105 and then drag down so the new cells are A106:D111. I now go to the next step which would be from E94:H99 highlight the cells and dragdown to E100:H105.......and so on across the page. Can I automate this process if so how.... cause this is a big spreadsheet. With thanks Bob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
this should do it: Sub FillSheet() Dim r&, n& With ActiveSheet For r = [a65536].End(xlUp).Row To 1 Step -6 .Cells(r, 4 * n + 1).Resize(6 * (n + 1), 4).FillDown n = n + 1 If Intersect(.Cells(r, 4 * n + 1), .UsedRange) Is Nothing Then Exit For End If Next End With End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Robert Gillard" wrote: Problem, I have a problem with a spreadsheet that comes down the page in "steps".(If you had a blank sheet of paper turn it landscape and draw a line from the bottom left hand corner to the top right hand corner and just look at the area above the line - that's the shape of the spreadsheet.) Each month I have to add a new step to those already there. Each step is 4 cols wide and 6 rows down, so for example this month I would highlight cells A100:D105 and then drag down so the new cells are A106:D111. I now go to the next step which would be from E94:H99 highlight the cells and dragdown to E100:H105.......and so on across the page. Can I automate this process if so how.... cause this is a big spreadsheet. With thanks Bob |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob
I'm not sure, what you mean by "drag down" (move or copy??), but this code may get you started: Sub InsertNewStep() 'Leo Heuser, 16 Sept. 2003 Dim StepBlock As Range Set StepBlock = Sheets("Ark2"). _ Cells(ActiveSheet.Rows.Count, 1). _ End(xlUp).Offset(-5, 0).Resize(6, 4) On Error Resume Next Do StepBlock.Offset(6, 0).Interior.ColorIndex = 3 Set StepBlock = StepBlock.Offset(-6, 4) Loop Until Err.Number 0 On Error GoTo 0 End Sub -- Best Regards Leo Heuser MVP Excel Followup to newsgroup only please. "Robert Gillard" skrev i en meddelelse ... Problem, I have a problem with a spreadsheet that comes down the page in "steps".(If you had a blank sheet of paper turn it landscape and draw a line from the bottom left hand corner to the top right hand corner and just look at the area above the line - that's the shape of the spreadsheet.) Each month I have to add a new step to those already there. Each step is 4 cols wide and 6 rows down, so for example this month I would highlight cells A100:D105 and then drag down so the new cells are A106:D111. I now go to the next step which would be from E94:H99 highlight the cells and dragdown to E100:H105.......and so on across the page. Can I automate this process if so how.... cause this is a big spreadsheet. With thanks Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copying | Excel Worksheet Functions | |||
Copying | Excel Discussion (Misc queries) | |||
copying the Hyperlink function result without copying the actual formula | Excel Worksheet Functions | |||
copying a row | Excel Discussion (Misc queries) | |||
Copying data down to next dirty cell, then copying that data | Excel Programming |