FINDING INFO IN HIDDEN CELLS

Fire_Chief

Well-known Member
Joined
Jun 21, 2003
Messages
693
Office Version
  1. 365
Platform
  1. Windows
I am trying to find info in a group of cells that are hidden.
It will give be an error message unless I unhide the cells.
THIS WORKS FIND:
Columns("LV:MK").Select
Selection.EntireColumn.Hidden = False

Range("LV399:MK452").Select
Selection.Find(What:=DIVISION, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

THIS WILL NOT WORK:

Range("LV399:MK452").Select
Selection.Find(What:=Division, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

I have done this in another park of the workbook (same page) without unhide it, and it works so I am confused.
I have also unlocked the entire workbook with no luck.
Tried forever to figure this out. Need help..


error message is:
Object variable or with block variable not set


Thank You
 
Last edited by a moderator:
I think I found my problem. Your code works but there is something different that I hope you can help me with.

When I write the word SOUTH in the bracket the code works.
However, that is not whats in the bracket. What is in the bracket is a reference from another cell. What is in the cell
that says SOUTH is =FP9 so it doesn't find SOUTH unless I unhide it. (not sure why)
I have tried this and it works with your code fine but I have to find a way to find SOUTH or I will have to unhide every time.

I hope I have explained good enough.

Marty
 
Upvote 0
Hmmm, I see what you mean. I have not come across this before (mostly because I am never really searching hidden ranges).
I found this thread which seems to talk about the problem and potential workarounds: Perform a find on hidden cells
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I think I fixed it.



Thank You
Can you post what your solution was?
Besides me being curious, it might also help people who stumble upon this thread in the future.
 
Upvote 0
Here is my code:

For T = 1 To 4
If T = 1 Then
AREA = "FP9" 'UNHIDDEN
AREA2 = "LX399" 'HIDDEN
ElseIf T = 2 Then
AREA = "FP12"
AREA2 = "LX424"
ElseIf T = 3 Then
AREA = "FR9"
AREA2 = "MH399"
ElseIf T = 4 Then
AREA = "FR12"
AREA2 = "MH424"
End If

If Range(AREA).Value = "SOUTH" Then
Range(AREA2).Value = "SOUTH"
ElseIf Range(AREA).Value = "MIDWEST" Then
Range(AREA2).Value = "MIDWEST"
ElseIf Range(AREA).Value = "EAST" Then
Range(AREA2).Value = "EAST"
ElseIf Range(AREA).Value = "WEST" Then
Range(AREA2).Value = "WEST"
End If
Next T

Excel Formula:

Hope you can understand my code. I am self taught. If not ask and I will explain.
 
Upvote 0
That might work but it may put in the reference again (=FP9). I am going to leave it as is.
It was tough figuring out what was wrong so I'm just glad to have it working.

I thank you for your input
 
Upvote 0

Forum statistics

Threads
1,216,025
Messages
6,128,336
Members
449,443
Latest member
Chrissy_M

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