Run-Time Eror 9

SDale

New Member
Joined
Nov 15, 2014
Messages
8
Good morning all.

I was wondering why I get this error sporadically. I have a Form that is used to enter new records on a Pipeline Forecast Report worksheet called "Forecast". What I have noticed is that if I have the Forecast worksheet on my display with the Form in the foreground it works fine. However, if I have another worksheet on my display with the UserForm in the foreground I'll get error 9 (the reason for another worksheet [typically a quote] is so the user can take information off the quote and enter it into the form. The error occurs if a line of code such as,
Sheets("Forecast").Select, or, a Set command is encountered. Is this because the Forecast worksheet needs to be active on my display instead of a different worksheet? If so, how do I make this happen with code so another user doesn't encounter this error. I am new to VBA and still learning all the ins and outs. Thanks in advance for any assistance.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
try nameing the workbook

workbook(name).sheets("forecast").select

excel is probably complaining the name isn't in the active worksbook
 
Upvote 0

Forum statistics

Threads
1,203,621
Messages
6,056,337
Members
444,861
Latest member
B4you_Andrea

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