Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When running the code below, I'm getting the error 'Name Argument Not Found'
and the 'LookAt:=xlPart' text is highlighted. Any ideas on what I'm doing wrong? Sub DateMacro1() Range("A1:O1").Select Selection.Replace What: InputBox ("Enter Date"), _ Replacement: InputBox ("Enter Date"), _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False, _ SearchFormat:=False, _ ReplaceFormat:=False End Sub Many thanks if you can help! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stan,
You're missing the = symbol after the What and Replacement parameters. You also don't need to select the range. try it this way Range("A1:O1").Replace What:=InputBox("Enter Date"), _ Replacement:=InputBox("Enter Date"), _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False, _ SearchFormat:=False, _ ReplaceFormat:=False -- Hope that helps. Vergel Adriano "Stan" wrote: When running the code below, I'm getting the error 'Name Argument Not Found' and the 'LookAt:=xlPart' text is highlighted. Any ideas on what I'm doing wrong? Sub DateMacro1() Range("A1:O1").Select Selection.Replace What: InputBox ("Enter Date"), _ Replacement: InputBox ("Enter Date"), _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False, _ SearchFormat:=False, _ ReplaceFormat:=False End Sub Many thanks if you can help! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks Vergel. That worked perfectly!
"Vergel Adriano" wrote: Stan, You're missing the = symbol after the What and Replacement parameters. You also don't need to select the range. try it this way Range("A1:O1").Replace What:=InputBox("Enter Date"), _ Replacement:=InputBox("Enter Date"), _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False, _ SearchFormat:=False, _ ReplaceFormat:=False -- Hope that helps. Vergel Adriano "Stan" wrote: When running the code below, I'm getting the error 'Name Argument Not Found' and the 'LookAt:=xlPart' text is highlighted. Any ideas on what I'm doing wrong? Sub DateMacro1() Range("A1:O1").Select Selection.Replace What: InputBox ("Enter Date"), _ Replacement: InputBox ("Enter Date"), _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ MatchCase:=False, _ SearchFormat:=False, _ ReplaceFormat:=False End Sub Many thanks if you can help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Another code question | Excel Discussion (Misc queries) | |||
Code Question | Excel Programming | |||
Code Question | Excel Programming | |||
VBA Code Question | Excel Programming | |||
VBA CODE Question | Excel Programming |