![]() |
VB Code Question
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! |
VB Code Question
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! |
VB Code Question
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! |
All times are GMT +1. The time now is 06:42 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com