Link to home
Start Free TrialLog in
Avatar of ca1358
ca1358

asked on

Please help with the syntax.

Excel VBA

I need to join these two statments together.  

Sheet22.Range("SRP") = Sheet38.Range("e6") / 100 and
Sheet22.Range("AA28:AA57") = Sheet38.Range("e6") / 100

Please help with the syntax.

Here is the whole piece of code.

///////////////////////////////////////////////////////

If Range("W28") = "Govt" Then
Sheet22.Range("SRP") = Sheet38.Range("e6") / 100
Sheet22.Range("AA28:AA57") = Sheet38.Range("e6") / 100
Else
Sheet22.Range("SRP") = Sheet38.Range("d6") / 100
Sheet22.Range("AA28:AA57") = Sheet38.Range("d6") / 100
End If
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America 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 ca1358
ca1358

ASKER

I am using this piece of code in two sections.

One after the Userform.Combo1 (AfterUpdate) and works fine but
I using it after a Combo1 (Change event) on the spreadsheet and I am getting error

Runtime 1004
Application-define or object deine error.

Any suggestions?

Thank you for you help!

Avatar of ca1358

ASKER

I have the answer.  I split the procedure and move one of them to another event.

Thanks for the help!