LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Variable not set

I have this macro running from a commandbutton in sheet2, it gets a
concatenated string and look it up in sheet24 once found retrieves datum from
sheet24 and shows it in an userform
I'm getting the variable/block not set error for rFound, cFound is working

Thanks in advance

Sub DirectLabor()

Dim Category
Dim Period
Dim Row
Dim Column
Dim Comment
Dim rFound As Range
Dim cFound As Range



Category = Sheet2.Range("A1") & Sheet2.Range("A77")

Period = Sheet2.Range("B3")



With Sheet24

Set rFound = Sheet24.Cells.Find(What:=Category, After:=Sheet24.Cells(1, 1),
LookIn:=xlValues

Row = rFound.Row



Set cFound = Sheet24.Cells.Find(What:=Period, After:=Sheet24.Cells(1, 1),
LookIn:=xlValues

Column = cFound.Column



Comment = Sheet24.Cells(Row, Column).Text


Frm1.Txt.Text = Comment

End With

Frm1.Show

End Sub

 
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
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
variable height variable width stacked bar charts ambthiru Charts and Charting in Excel 3 January 18th 06 11:41 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 01:43 PM.

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

About Us

"It's about Microsoft Excel"