LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Why Am I Getting the "Named Argument Not Found" Warning?

I've inherited the macro below. It prompts the user to enter a person's name
and a lesson number. (This is for keeping track of the use of proper names in
a textbook development project.) It then looks on a master list of names on
another sheet ("Alll Names") to see if it's approved for use. If so, it
deposits some info in a few columns on the original sheet for tracking
purposes.

Sub ClassifyName()
myRow = ActiveCell.Row
CurrentSheet = ActiveSheet.Name
UserInput$ = InputBox$("Name,Lesson")
i = InStr(1, UserInput$, ",")
If i 0 Then
uName$ = Left$(UserInput$, i - 1)
uLesson$ = Mid$(UserInput$, i + 1)
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("All Names").Select
On Error GoTo NoSuchName
Cells.Find(What:=uName$, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase _
:=False, SearchFormat:=False).Activate
If Selection.Interior.ColorIndex = 46 Then
MsgBox uName$ + " has been used previously."
Exit Sub
End If
With Selection.Interior
.ColorIndex = 46
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Offset(0, 1).Select
EthnicGroup = Val(Selection.Offset(0, 0).Text)
Selection.Offset(0, 1).Select
SexIndicator = Val(Selection.Offset(0, 0).Text)
Selection.Offset(0, 1).Select
Sheets(CurrentSheet).Select
ActiveCell.FormulaR1C1 = uLesson$
Worksheets(CurrentSheet).Cells(myRow, 2).Select
ActiveCell.FormulaR1C1 = uName$
Worksheets(CurrentSheet).Cells(myRow, EthnicGroup).Select
ActiveCell.FormulaR1C1 = 1
If SexIndicator 0 Then
Worksheets(CurrentSheet).Cells(myRow, SexIndicator).Select
ActiveCell.FormulaR1C1 = 1
End If
Worksheets(CurrentSheet).Cells(myRow + 1, 1).Select
Else
MsgBox "Your input was invalid!"
End If
Exit Sub
NoSuchName:
MsgBox "Your name was not found!"
End Sub

When I try to run this, I get the awful named argument not found box. Help!
Does anyone have any ideas? I'm trying to run this on a Mac, and the macro
was originally used on a PC, but I honestly don't see what in this would
cause my Mac to cry.
 
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
Duplicate Value warning yukon_phil Excel Worksheet Functions 6 July 18th 06 06:09 PM
Warning about different sizes of paste areas Sam Excel Discussion (Misc queries) 0 May 10th 06 10:21 PM
Need Function Argument pasekm Excel Worksheet Functions 4 March 18th 06 11:14 PM
Copy / Paste Warning wbmcse Excel Discussion (Misc queries) 0 March 3rd 06 07:04 PM
How do I set up an argument which asks for multiple criteria HiTekDiver Excel Discussion (Misc queries) 3 August 29th 05 11:32 PM


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