Hi!
I desperately need some help with some excel macros, can anybody help please?
I need the VBA code so that an excel macros will run once automatically when, for example cell A4 = 1.
Using a great thread posted by Zack Barresse, I've managed to get this far with the VBA:
Sub copytohere()
If ThisWorkbook.Sheets("Sheet1").Range("A4").Value = "1" Then
Range("A1").Select
Selection.Copy
Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
Selection.ClearContents
End If
End Sub
I dont think I've got it quite right though...
Can anyone help please? :-)
This macros is basic - all it does is copy data from cell A1 to E1 and then deletes A1.
I was hoping the IF statement would make the macros run once automatically when cell A4 = 1 however when I enter 1 into cell A4 nothing happens.
What is interesting is that if i then go to run the macros manually, it will perform the macros correctly if cell A4 = 1 .If cell A4 doesn't equal 1 and I run the macros manually, nothing happens.
I need the VBA so that the macros will run once automatically when cell A4 equals 1.
Any help si much appreciated.
Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!!!
Paddy
Hello and welcome to the forum. Please take a moment to read the forum rules.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.
Thread Closed.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks