One More Try To Run This Macro With A Formula

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,196
Office Version
  1. 2010
Platform
  1. Windows
I have this code..
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("E3")) Is Nothing Then Macro
    Sheets("Sheet3").Select
    Range("E3:E24").Select
    Selection.Copy
    Sheets("Sheet2").Select
    Range("E3:E24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub

Can I make this run when a cell or some cells in a range of cells (sheet 3 E3:E24) gets filled by a formula? This works when I use a command button but I would like it to just run when the other cells get filled. I seen a lot of ideas but none work, can an IF formula make a macro run? Thanks
 
As soon as I paste the report in sheet 1, I get this error, Compile Error: Syntax error. It then all stops.
Code:
[COLOR=black]Private Sub Worksheet_Change(ByVal Target As Range)[/COLOR]
    If Not Application.Intersect(Target, Range("P:P,B:B") Is Nothing Then
        With ThisWorkbook
            .Sheets("Sheet2").Range("E3:E24")).Value = .Sheets("Sheet3").Range("E3:E24")).Value
        End With
    End If
End Sub

Do I remove any of the other formulas ot macro?
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
HTML:
There are two extra parenthesis.

I'm not sure what you mean by that? If you mean the condistional format code, it is what I was told to use and it does work.
 
Upvote 0
So in the code you gave me it needs 2 parenthesis removed from someplace? Correct.
 
Upvote 0
So in the code you gave me it needs 2 parenthesis removed from someplace? Correct.

Here is the problematic code line with the extra parentheses hightlighted in red...

Code:
.Sheets("Sheet2").Range("E3:E24")[SIZE=3][COLOR=darkred][B])[/B][/COLOR][/SIZE].Value = .Sheets("Sheet3").Range("E3:E24")[SIZE=3][COLOR=darkred][B])[/B][/COLOR][/SIZE].Value
 
Upvote 0
Same error, the line highlighted lines now is..
Code:
IN YELLOW - Private Sub Worksheet_Change(ByVal Target As Range)
IN RED - If Not Application.Intersect(Target, Range("P:P,B:B") Is Nothing Then
 
Upvote 0
You are missing a parenthesis there:
Rich (BB code):
If Not Application.Intersect(Target, Range("P:P,B:B")) Is Nothing Then
 
Upvote 0
IT WORKS! Thank you so much for the help. I took the other macro out, I see it works without that one. Some day I will learn this better, for now many thanks.
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,916
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top