Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with an error message


My macro has worked fine previously and all of a sudden this error
message comes up:

Object Variable or WIth block variable not set

This happens on the last line of this:

Sheets("Menu").Select
Future = Cells(34, 2).Value
If Future = Empty Then GoTo 1
Sheets("Portfolio Valuation").Select
Cells.Find(What:=Future).Select

Basically I am asking the marco to seach for the word Liab, which I
have entered a on a sheet, and it calls this Future as above. Then it
seaches for this word on the sheet Portfolio Valuation.

Please help!!!


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=560184

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Help with an error message

There is nothing intrinsically wrong with your code. You are getting the
error because it cannot find, on the Portfolio Valuation sheet, the text it
read from cell B34 on the Menu sheet (which you have assigned to the variable
Future).

Possibilities:
- You entered the search text (Liab) incorrectly
- You entered it into the wrong cell (not B34 on the Menu sheet)
- The search text doesn't exist on the Portfolio Valuation sheet

If the .Find may fail sometimes in your routine and that's legitimate, you
need to add some error handling.

Hope this helps,

Hutch

"CarolineHedges" wrote:


My macro has worked fine previously and all of a sudden this error
message comes up:

Object Variable or WIth block variable not set

This happens on the last line of this:

Sheets("Menu").Select
Future = Cells(34, 2).Value
If Future = Empty Then GoTo 1
Sheets("Portfolio Valuation").Select
Cells.Find(What:=Future).Select

Basically I am asking the marco to seach for the word Liab, which I
have entered a on a sheet, and it calls this Future as above. Then it
seaches for this word on the sheet Portfolio Valuation.

Please help!!!


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=560184


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replace VBA run-time error message with custom message BEEJAY Excel Programming 13 July 14th 06 03:59 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
Excel XP error message Run Time Error 91 Lenny[_3_] Excel Programming 1 March 3rd 05 10:15 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"