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: 333
Default Match Error

Hi,

I am tryihg to compare the worksheet names between two worksheets to a list
on the main page. If it does not exist on the main page list the sheet name
is placed on the maintenance page. I get a method range of object worksheet
failed message. I've been trying to find an explanation with not luck. What
does this error mean and how do I fix it?

Also, I've sometimes seen the Set cleared with Set Whatever = Nothing, but I
usually don't see it. What is the best practice and what are the
ramifications if it's done vs not done?

Thanks for your help.

Dim ws As Worksheet
Dim FirstIndex As Long
Dim LastIndex As Long
Dim Nuserow As Long
Dim Lusedrow As Long
Dim CellRange As Range

'get the last cell on Main Page for the sheet names in BD
Lusedrow = MainPagepg.Cells(Rows.Count, "BD").End(xlUp).Row

Set CellRange = MainPagepg.Range("BD13:BD" & Lusedrow)
FirstIndex = Firstpg.Index
LastIndex = Lastpg.Index
ShNotLogged = False

For Each ws In ThisWorkbook.Worksheets
If ws.Index FirstIndex Then
If ws.Index < LastIndex Then
If (IsError(Application.WorksheetFunction.Match(ws.Na me,
CellRange, 0))) Then
With Maintenancepg
'find the next empty cell on maintenance page
Nuserow = Maintenancepg.Cells(Rows.Count,
"B").End(xlUp).Row + 1
'save the missing sheet name
Maintenancepg.Cells(Nuserow, 2).Value = ws.Name
ShNotLogged = True
End With
End If
End If
End If
Next ws
--
Thanks for your help.
Karen53
 
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
match error Belinda7237 Excel Worksheet Functions 3 August 8th 08 04:20 PM
Getting a MATCH error Lulu Montiel[_2_] Excel Discussion (Misc queries) 1 April 4th 08 05:44 PM
Error Type Mis Match Error 13 Gordon[_2_] Excel Programming 1 December 20th 04 02:40 PM
Formula MATCH error peterfc2 Excel Worksheet Functions 1 November 8th 04 05:07 PM
VBA Match Error tbieri Excel Programming 1 June 25th 04 11:24 PM


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