chipsworld
Board Regular
- Joined
- May 23, 2019
- Messages
- 169
- Office Version
- 365
Hey All...
I know I am missing a period or comma or something in the below, but can not figure it out. Any help would be greatly appreciated
I know I am missing a period or comma or something in the below, but can not figure it out. Any help would be greatly appreciated
VBA Code:
Dim ws As Worksheet
Dim tbl As ListObject
Dim cell As Range
Dim oldChar As String
Dim newChar As String
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Delete Analysis")
' Set the table
Set tbl = ws.ListObjects("Table1") 'Set table name from sheet
oldChar = "/" ' Character to be replaced
newChar = "-" ' New character
' Loop through each cell in column F of the table
For Each cell In tbl.ListColumns("F").DataBodyRange
If Not IsEmpty(cell) Then
cell.Value = Replace(cell.Value, oldChar, newChar)
End If
Next cell