Hey everyone,
I have a startup code that I found but I haven't been able to set it up to my required needs.
In VBA I want to do the following:
1. I want to: Search the workbook in column A for something like the word "*Dollars*.
2. The code locates which rows have the keyword dollars and formats the whole row to currency.
I've gotten started a little bit but I get a run-time error:
I have a startup code that I found but I haven't been able to set it up to my required needs.
In VBA I want to do the following:
1. I want to: Search the workbook in column A for something like the word "*Dollars*.
2. The code locates which rows have the keyword dollars and formats the whole row to currency.
I've gotten started a little bit but I get a run-time error:
Code:
Sub MM1()
Dim i As Long
Columns("A:A").NumberFormat = "#,##0"
For i = 1 To Rows.Count
Next i
[COLOR=red]If Cells(i, 1).Value = "*dollar*" And Not IsEmpty(Cells(i, 1).Value) Then
[/COLOR]Cells(i, 1).NumberFormat = "$#,##0.00"
End If
End Sub