Hi, this is my first post. I'm only a novice with VBA and creating macros. I try to stick the basics and recording. I usually do a pretty good job of figuring it out on my own through google and this forum, but I haven't been able to find any help with this latest macro I'm trying to make. I'm hoping someone here might be able to help. I've created a workbook to track construction estimates and spending. I have an 'Estimates' worksheet which contains all the work items within a contract in the rows, and the columns contain the individual estimates (Est. 1, Est. 2, etc.). After the last estimate, I have a 'Contract Total' column which just sum's up the row for each item. When I want to add in the costs for the latest estimate, I would just manually insert a new column to the left of the 'Contract Total' column, then autofill everything from the previous estimate to the right.
I'm trying to create a macro to do this all automatically so that I can give the workbook file to another employee that isn't very well versed with Excel to track his own contracts. Here's what I was able to come up with through recording a macro:
Sub InsertNewEstimate()
Columns("D:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C3:C3").Select
Selection.AutoFill Destination:=Range("C3:D3"), Type:=xlFillDefault
Range("C3:D3").Select
End Sub
The problem with it is the column needs to be variable, not set like above. Instead of always inserting the new column at D and moving the rest of the columns to the right, I want it to insert the new column at D for Est. 2, E for Est. 3, F for Est. 4, etc.
Sorry for the long post, I'm just trying to make myself clear. Hopefully I didn't make it out to be more confusing. Any help would be greatly appreciated.
Thanks,
Aaron
I'm trying to create a macro to do this all automatically so that I can give the workbook file to another employee that isn't very well versed with Excel to track his own contracts. Here's what I was able to come up with through recording a macro:
Sub InsertNewEstimate()
Columns("D:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C3:C3").Select
Selection.AutoFill Destination:=Range("C3:D3"), Type:=xlFillDefault
Range("C3:D3").Select
End Sub
The problem with it is the column needs to be variable, not set like above. Instead of always inserting the new column at D and moving the rest of the columns to the right, I want it to insert the new column at D for Est. 2, E for Est. 3, F for Est. 4, etc.
Sorry for the long post, I'm just trying to make myself clear. Hopefully I didn't make it out to be more confusing. Any help would be greatly appreciated.
Thanks,
Aaron