Newbee - Replace values in a Column

P

Pete Beatty

I am working with a sheet that has several columns that contain "True" or
"False" data in the cells. I have been able to change all "True" to "Yes"
and "False" to space, wherever they exist in the sheet. I now want to
change any "Yes" values, within a column to a space. The column is "G" and
has "CardReq" in the first cell position.

I use the following code to make the current changes and would like to add
the new code to this routine. Can anyone assist??

' setup the filename and open it...
Set mySheet = xlApp.WorkBooks.Open(xlsFile).Sheets(1)
TotalRows = mySheet.UsedRange.Rows.Count
TotalColumns = mySheet.UsedRange.Columns.Count

' Replace all "TRUE" cells with "Yes"
mySheet.Cells.Replace What:="True", _
Replacement:="Yes", _
LookAt:=xlPart, _
MatchCase:=False

' Replace all "FALSE: cells with a single space
mySheet.Cells.Replace What:="False", _
Replacement:=Space$(1), _
LookAt:=xlPart, _
MatchCase:=False

' Save the worksheet and close the application
mySheet.Application.ActiveWorkbook.Save
mySheet.Application.ActiveWorkbook.Close
xlApp.Quit
 
Top