Hi everyone, this is my first post here so I hope you can help
Here is the code I have so far:
Sub Update()
Columns("H:J").Select
Selection.EntireColumn.Hidden = False
Range("H7").Select
Selection.AutoFill Destination:=Range("H7:H306"), Type:=xlFillDefault
Range("I7").Select
Selection.AutoFill Destination:=Range("I7:I306"), Type:=xlFillDefault
Range("J7").Select
Selection.AutoFill Destination:=Range("J7:J306"), Type:=xlFillDefault
Range("B7:B9").Select
Selection.AutoFill Destination:=Range("B7:B306"), Type:=xlFillDefault
Columns("H:J").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
End Sub
At the end when I want columns H:J to be hidden, it does not do this. I have this macro on a button, and when I click on the button it hides columns B:J instead. Then I have to manually unhide these columns that I don't want to be hidden (B:G) otherwise I can't see anything. Can anyone see where I am going wrong?
Also, I have Excel 2007 but I have made this worksheet into the 2003 version because it is for my friend who only has Excel 2003.
Any help would be much appreciated. Many thanks
Here is the code I have so far:
Sub Update()
Columns("H:J").Select
Selection.EntireColumn.Hidden = False
Range("H7").Select
Selection.AutoFill Destination:=Range("H7:H306"), Type:=xlFillDefault
Range("I7").Select
Selection.AutoFill Destination:=Range("I7:I306"), Type:=xlFillDefault
Range("J7").Select
Selection.AutoFill Destination:=Range("J7:J306"), Type:=xlFillDefault
Range("B7:B9").Select
Selection.AutoFill Destination:=Range("B7:B306"), Type:=xlFillDefault
Columns("H:J").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
End Sub
At the end when I want columns H:J to be hidden, it does not do this. I have this macro on a button, and when I click on the button it hides columns B:J instead. Then I have to manually unhide these columns that I don't want to be hidden (B:G) otherwise I can't see anything. Can anyone see where I am going wrong?
Also, I have Excel 2007 but I have made this worksheet into the 2003 version because it is for my friend who only has Excel 2003.
Any help would be much appreciated. Many thanks