Link to home
Start Free TrialLog in
Avatar of randys106
randys106Flag for United States of America

asked on

Worksheet Change Syntax Troubles

I am trying to manually call the Worksheet_Change Subroutine.  My code looks like this...


Private Sub mySubroutine()
…code…
Call Worksheet_Change (Temp)
…code…
End Sub

Open in new window


Temp is a named range.  The error I get is "Object Required".

I have also tried things like "$A$1:$A$1" and its variations.  Here I get a type mismatch error.

I do not need the target to point to anything, I just need the subroutine to run.

Ideas?


Avatar of redmondb
redmondb
Flag of Afghanistan image

randys106

Total cheat, but (assuming the sheet is "Sheet1"), what about replacing the Call line by...
Sheets("Sheet1").Cells(1, 1).Formula = Cells(1, 1).Formula

Open in new window

Regards,
Brian.
ASKER CERTIFIED SOLUTION
Avatar of redmondb
redmondb
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of randys106

ASKER

Yes its a cheat...and a damn beautiful one.  I like it!  It worked perfectly.
Thanks, glad to help!