Hiya
I am very new to VBA and teaching myself through recording and editing macros and forums like this.
I am really stuck however when trying to run a code, which works fine as part of a macro but when I link it to a command button, I get the following error -Runtime error 424 - Object required. I have run the macro line by line by F8 and it failes when it gets to the line where I try and get it to select cell XFD8
Sheets("Pivot 6 Month").Select
Range("XFD41").Select
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, -1).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Table").Select
Select.Range("XFD8").Select
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, -1).Select
Selection.PasteSpecial Paste:=xlPasteValues
It works fine in my earlir code, when I try and select cells in this manner but falls down at this point. Any help would be much appreciated!
Thanks
Emma
I am very new to VBA and teaching myself through recording and editing macros and forums like this.
I am really stuck however when trying to run a code, which works fine as part of a macro but when I link it to a command button, I get the following error -Runtime error 424 - Object required. I have run the macro line by line by F8 and it failes when it gets to the line where I try and get it to select cell XFD8
Sheets("Pivot 6 Month").Select
Range("XFD41").Select
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, -1).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Table").Select
Select.Range("XFD8").Select
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, -1).Select
Selection.PasteSpecial Paste:=xlPasteValues
It works fine in my earlir code, when I try and select cells in this manner but falls down at this point. Any help would be much appreciated!
Thanks
Emma