Solved

Excel Debug Object Required

Posted on 2011-09-14
7
341 Views
Last Modified: 2012-05-12
I need to add three buttons to an Excel form to eliminate the billing and typo errors that people are making.

Button 1 = Company 1
Button 2 = Company 2
Button 3 = Collect shipment

I added the buttons and attached a macro to each, but I keep getting the Run-time error'424' Object required.

The three macros are:

Sub BillToOptionButton1()
'
' BillToOptionButton Macro
' Macro recorded 9/12/2011 by Tosagua'

Application.ScreenUpdating = False
If OptionButton1.Value = True Then
       Range("C20").Value = " COMPANY 1 NAME."
       Range("C21").Value = " MAIL  CODE  7A"
       Range("C22").Value = " STREET  ADDRESS."
       Range("C23").Value = " CITY,  STATE  ZIP"
   End If

Application.ScreenUpdating = True
   
'
End Sub

Sub BillToOptionButton2()
'
' BillToOptionButton Macro
' Macro recorded 9/12/2011 by Tosagua
'
    Application.ScreenUpdating = False
   If OptionButton2.Value = True Then
       Range("C20").Value = " COMPANY 2 NAME"
       Range("C21").Value = " C/O  ANOTHER COMPANY."
       Range("C22").Value = " STREET ADDRESS."
       Range("C23").Value = " CITY,  STATE,  ZIP"
   End If

Application.ScreenUpdating = True
   
'
End Sub


Sub BillToOptionButton3()
'
' BillToOptionButton Macro
' Macro recorded 9/12/2011 by Tosagua
'

If OptionButton3.Value = True Then
    MsgBox "Enter The   BILL TO   Information."
Range("C20").Select
End If
'
End Sub


Any assistance or guidance would be greatly appreciated.

Thank you,

Tosagua
0
Comment
Question by:Tosagua
  • 4
  • 3
7 Comments
 
LVL 24

Expert Comment

by:StephenJR
ID: 36535700
Where have you put this code?
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 36535703
If you try adding the userform, does that help?

E.g.
If UserForm1.OptionButton1.Value = True Then

Open in new window

0
 

Author Comment

by:Tosagua
ID: 36535903
StephenJR,

The macros are in the same workbook as the form.
Adding Userform1 or the name of the worksheet has no benefit.

Tosagua
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Expert Comment

by:StephenJR
ID: 36536003
Tosagua - are you able to post a workbook, with just one button perhaps? I can't replicate your error.
0
 

Author Comment

by:Tosagua
ID: 36536274
StephenJR,

Sample workbook is attached.

The buttons are in the Red Box beneath the form.

Tosagua
BUTTON-TEST-FILE---09-08-11.xls
0
 
LVL 24

Accepted Solution

by:
StephenJR earned 500 total points
ID: 36536480
It didn't work because you were not using Form buttons but those from the Control menu. You can set a cell link (right-click, format control) and then use code to check the value of the linked cell. In attachment I added second sheet and when a button is clicked A1 records 1, 2 or 3. The buttons are linked to macro which checks that value.
BUTTON-TEST-FILE---09-08-11.xls
0
 

Author Closing Comment

by:Tosagua
ID: 36536535
StephenJR,

Excellent.

Thank you very much.

Tosagua
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now