Solved

Please help with the syntax.

Posted on 2006-07-12
3
148 Views
Last Modified: 2010-04-30
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
0
Comment
Question by:ca1358
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 17093460
Define ' join these two statments together.  '.  Test them together as a condition?

The VB code you have below the //// line appears fine.
0
 

Author Comment

by:ca1358
ID: 17093721
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!

0
 

Author Comment

by:ca1358
ID: 17095209
I have the answer.  I split the procedure and move one of them to another event.

Thanks for the help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA filters 2 81
Getting warning: You are about to delete 1 row(s) 9 61
Set WorkSheet  not Working 9 62
Word formfield existence 3 16
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question