Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following
Sub FillZeros() Sheets("Records").Select Range("N2:N500").Select Application.CutCopyMode = False Cells.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False End Sub When I run it I get 5 additional cols of zeros Oldjay |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try: Selection.Replace instead of Cells.Replace
HTH -- AP "Oldjay" a écrit dans le message de news: ... I have the following Sub FillZeros() Sheets("Records").Select Range("N2:N500").Select Application.CutCopyMode = False Cells.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False End Sub When I run it I get 5 additional cols of zeros Oldjay |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks everybody
"Ardus Petus" wrote: Try: Selection.Replace instead of Cells.Replace HTH -- AP "Oldjay" a Ʃcrit dans le message de news: ... I have the following Sub FillZeros() Sheets("Records").Select Range("N2:N500").Select Application.CutCopyMode = False Cells.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False End Sub When I run it I get 5 additional cols of zeros Oldjay |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False This statement replaces empty strings "". Try Cells.Replace What:=" ", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False but first check that you want to replace all spaces in all cells (LookAt:=xlPart) or only those standing alone in a cell (LookAt:=xlWhole) Regards, Stefi €˛Oldjay€¯ ezt Ć*rta: I have the following Sub FillZeros() Sheets("Records").Select Range("N2:N500").Select Application.CutCopyMode = False Cells.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False End Sub When I run it I get 5 additional cols of zeros Oldjay |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub FillZeros() Sheets("Records").Select Range("N2:N500").Select Application.CutCopyMode = False Selection.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False End Sub -- Regards, Tom Ogilvy "Oldjay" wrote: I have the following Sub FillZeros() Sheets("Records").Select Range("N2:N500").Select Application.CutCopyMode = False Cells.Replace What:="", Replacement:=0, LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False End Sub When I run it I get 5 additional cols of zeros Oldjay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Replacing spaces with data from another cell | Excel Discussion (Misc queries) | |||
Replacing spaces with a line end | Excel Discussion (Misc queries) | |||
Replacing spaces in text, with another character | Excel Worksheet Functions | |||
Replacing specific characters with spaces | Excel Worksheet Functions | |||
replacing spaces? | Excel Programming |