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: 19
Default Run-time Error'91: Object variable or With block variable not set

I am developing a macro that among other things hides columns where the text
"Index" is found. However I am encountering the following error:

Run-time Error'91: Object variable or With block variable not set

I have played around with it but I can't seem to get rid of that error..
Can anyone help?

Private Sub ColumnFinder()
Dim FirstAddress As String
Dim c As Variant
'Macro identifies Index columns
With ActiveSheet.Range("a6:iv6")
Set c = .Find("Index", LookIn:=xlValues)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
PresentAddress = c.Address
'c.Offset(-1, 0).Value = PresentAddress 'Check step
c.Value = "Index"
'c.Interior.ColorIndex = 3'check step
Call CycleThrough
' Discard columns
c.EntireColumn.Hidden = True<---------This is the problem
statement

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < FirstAddress
End If
End With
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
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
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
Pivot Table - Object variable or with block variable not set? George Nicholson[_2_] Excel Programming 1 April 16th 04 09:12 PM
Error 91 - Object variable with block variable not set Jim[_35_] Excel Programming 2 November 27th 03 03:34 AM


All times are GMT +1. The time now is 09:39 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"