I have a table ~100 rows long and 206 columns wide.
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD][/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K.....HA
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Cust# 1
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Max Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Cust #2
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Max Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
[TR]
[TD]3......
[/TD]
[TD]Cust #3
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Max Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]Cust #100
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Daily Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
</TBODY>[/TABLE]
Now I need to split each customer' day into 24 hours (involving adding 25 rows (24 hours + a total) between each customer. I also need to move the data currently in $I$1:$HA$1 to $I$2:$HA$$2 but only after I have inserted the rows. If I do this manually it is going to take forever. Is there a way of doing it efficiently with VBA?
Below is the recorded macro of my manual actions together with narrative of each action
' rowinsertxple Macro
'
'Step 1: Insert 27 new rows beneath the first row of my table
Range("D594:D620").Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
'This moves the data in the first row J - HA down 1 row
Range("J593").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut Destination:=Range("J594:HA594")
'This copies a defined range of formulas into newly created rows
Range("J594:HA594").Select
Application.Goto Reference:="Copy_Paste"
Selection.Copy
Range("D595").Select
ActiveSheet.Paste
Application.CutCopyMode = False
'This copies a defined range of formulas into what was formerly the first row (column j-h) of the table
Application.Goto Reference:="Season"
Selection.Copy
Range("J593").Select
ActiveSheet.Paste
End Sub
I need to repeat this 100 times.......
Is there shorter way of doing this?
Thanks in advance
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD][/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K.....HA
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Cust# 1
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Max Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Cust #2
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Max Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
[TR]
[TD]3......
[/TD]
[TD]Cust #3
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Max Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]Cust #100
[/TD]
[TD]Gen Type
[/TD]
[TD]Demand Profile
[/TD]
[TD]Daily Contract Qty
[/TD]
[TD]Blank
[/TD]
[TD]Label
[/TD]
[TD][/TD]
[TD]Lookup formula
[/TD]
[/TR]
</TBODY>[/TABLE]
Now I need to split each customer' day into 24 hours (involving adding 25 rows (24 hours + a total) between each customer. I also need to move the data currently in $I$1:$HA$1 to $I$2:$HA$$2 but only after I have inserted the rows. If I do this manually it is going to take forever. Is there a way of doing it efficiently with VBA?
Below is the recorded macro of my manual actions together with narrative of each action
' rowinsertxple Macro
'
'Step 1: Insert 27 new rows beneath the first row of my table
Range("D594:D620").Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
'This moves the data in the first row J - HA down 1 row
Range("J593").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut Destination:=Range("J594:HA594")
'This copies a defined range of formulas into newly created rows
Range("J594:HA594").Select
Application.Goto Reference:="Copy_Paste"
Selection.Copy
Range("D595").Select
ActiveSheet.Paste
Application.CutCopyMode = False
'This copies a defined range of formulas into what was formerly the first row (column j-h) of the table
Application.Goto Reference:="Season"
Selection.Copy
Range("J593").Select
ActiveSheet.Paste
End Sub
I need to repeat this 100 times.......
Is there shorter way of doing this?
Thanks in advance