Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this code in a macro:
Sheets("Sheet 1").Select For j = 9 To 39 Cells(j, "A").Replace What:="/", Replacement:="¦" Cells(j, "A").Replace What:="\", Replacement:="|" Cells(j, "A").Replace What:="[", Replacement:="€¹" Cells(j, "A").Replace What:="]", Replacement:="€º" Next j The problem is instead of only looking in cells A9 to A39 in Sheet 1 for these characters to replace the macro looks in ALL cells in ALL sheets in the workbook! Why is this? Thanks Clayton |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Found out why this is happening. In excel if I select Edit|Replace, Options
and I change the "Within" field from Workbook to Sheet the below works. Is there a way to force "Within" to be Sheet in Vb? "mcphc" wrote: I have this code in a macro: Sheets("Sheet 1").Select For j = 9 To 39 Cells(j, "A").Replace What:="/", Replacement:="¦" Cells(j, "A").Replace What:="\", Replacement:="|" Cells(j, "A").Replace What:="[", Replacement:="€¹" Cells(j, "A").Replace What:="]", Replacement:="€º" Next j The problem is instead of only looking in cells A9 to A39 in Sheet 1 for these characters to replace the macro looks in ALL cells in ALL sheets in the workbook! Why is this? Thanks Clayton |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I find/replace data in selected cells only | Excel Worksheet Functions | |||
Copy and replace xlsm files, but retain the values in selected cells... | Excel Discussion (Misc queries) | |||
Find/Replace Macro with format changes to the replacing number | Excel Programming | |||
Using Replace command for replacing a character by an ALT+ENTER | Excel Worksheet Functions | |||
How do I replace an asterisk without replacing everything? | Excel Discussion (Misc queries) |