Mr_Ragweed
Board Regular
- Joined
- Dec 10, 2012
- Messages
- 74
Hello. I'm trying to write a simple macro that loops through each row a data on a single sheet. If the value in Column C is "Percent" i need to select range "D:M" on that row and convert the number format to percent. If the value in Column C is "Dollars" in need to select the range and convert the number format to dollars.
My code is below:
The problem is the enire columns D:M are being formatted as one instead of formatting each row.
Any help is much appreciated.Thank You.
My code is below:
Code:
Sheets("ProductFormulas").Select
ActiveSheet.Range("D:M").Name = "displays"
For I = 2 To NewFinalRow
If ActiveSheet.Cells(NewFinalRow, 3).Value = "Percent" Then
ActiveSheet.Range("displays").Select
Selection.NumberFormat = "0.00%"
ElseIf ActiveSheet.Cells(NewFinalRow, 3).Value = "Dollars" Then
ActiveSheet.Range("displays").Select
Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
End If
Next I
The problem is the enire columns D:M are being formatted as one instead of formatting each row.
Any help is much appreciated.Thank You.