jgoodman00
Programmer
- Jan 23, 2001
- 1,510
I am using VBA to open an Excel Workbook. This workbook contains a number of worksheets created by a series of dts packages which export data from SQL Server.
The data coming from SQL Server has a lot of True/False columns. I need to convert the True/False entries to Yes/No respectively.
Here is the code I am trying:
It never works, always stating the search string could not be found...
Any suggestions?
James Goodman MCSE, MCDBA
The data coming from SQL Server has a lot of True/False columns. I need to convert the True/False entries to Yes/No respectively.
Here is the code I am trying:
Code:
'Open the excel file
Set objExcelDoc = objExcel.Workbooks.Open(strTarget)
Dim i As Integer
On Error Resume Next
With objExcel
.Cells.Replace What:="FALSE", Replacement:="No", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
.Cells.Replace What:="TRUE", Replacement:="Yes", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End With
It never works, always stating the search string could not be found...
Any suggestions?
James Goodman MCSE, MCDBA