Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello, I tried to use vba to perform find and replace for the first 2 columns of a few sheets say the column F1 Sheets(2).Range("F1").Select Selection.Replace what:=" ", Replacement:="_", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False But in the end, all of the cells are processed. I'd like to know how should I limit the find and replace range properly? -- level3 ------------------------------------------------------------------------ level3's Profile: http://www.excelforum.com/member.php...o&userid=34541 View this thread: http://www.excelforum.com/showthread...hreadid=543036 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("F:G").Select
THEN do the find "level3" wrote: Hello, I tried to use vba to perform find and replace for the first 2 columns of a few sheets say the column F1 Sheets(2).Range("F1").Select Selection.Replace what:=" ", Replacement:="_", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False But in the end, all of the cells are processed. I'd like to know how should I limit the find and replace range properly? -- level3 ------------------------------------------------------------------------ level3's Profile: http://www.excelforum.com/member.php...o&userid=34541 View this thread: http://www.excelforum.com/showthread...hreadid=543036 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Bob, Thanks for the reply I tried many ways including your suggestion and something like this Sheets(2).Activate Range("A:B").Select Selection.Replace what:="_", Replacement:=" ", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Range("F:G").Select Selection.Replace what:=" ", Replacement:="_", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False But still, every cells' spaces are converted to underscore. even though I turned on the screen update and saw the selections were made correctly -- level3 ------------------------------------------------------------------------ level3's Profile: http://www.excelforum.com/member.php...o&userid=34541 View this thread: http://www.excelforum.com/showthread...hreadid=543036 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is...
Range("F:G").Replace what:=" ", Replacement:="_", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False (No need to select first) "level3" wrote: Hello, I tried to use vba to perform find and replace for the first 2 columns of a few sheets say the column F1 Sheets(2).Range("F1").Select Selection.Replace what:=" ", Replacement:="_", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False But in the end, all of the cells are processed. I'd like to know how should I limit the find and replace range properly? -- level3 ------------------------------------------------------------------------ level3's Profile: http://www.excelforum.com/member.php...o&userid=34541 View this thread: http://www.excelforum.com/showthread...hreadid=543036 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find & replace in one column | Excel Discussion (Misc queries) | |||
Find and Replace on just One Column | Excel Discussion (Misc queries) | |||
Find and Replace in a column | New Users to Excel | |||
How to find/replace data in column | Excel Discussion (Misc queries) | |||
How to find/replace data in column | New Users to Excel |