SteveOranjin
Board Regular
- Joined
- Dec 18, 2017
- Messages
- 170
Hi all,
Hope you're well. I'm sort of a journeymen VBA guy that can write macros if needs be, but I'm nothing special. I'm a little rusty right now, but I did a little research online and found this macro that finds a column, and then is supposed to format the column as a 'number' and supposedly convert it into a value as well. I'm looking for a macro that will turn a number into a '##.##' type of value, so '23.39' and will not contain any extra decimals in it.
I'd like it to do this for columns with the header, "MSRP", "MAPprice" and "DNprice" if they are present.
Can someone confirm my thinking on this macro and help me understand what the steps would be implement an alternative?
Steve
Hope you're well. I'm sort of a journeymen VBA guy that can write macros if needs be, but I'm nothing special. I'm a little rusty right now, but I did a little research online and found this macro that finds a column, and then is supposed to format the column as a 'number' and supposedly convert it into a value as well. I'm looking for a macro that will turn a number into a '##.##' type of value, so '23.39' and will not contain any extra decimals in it.
I'd like it to do this for columns with the header, "MSRP", "MAPprice" and "DNprice" if they are present.
Can someone confirm my thinking on this macro and help me understand what the steps would be implement an alternative?
Code:
Sub FindAddressColumn()
'Updateby Extendoffcie
Dim xRg As Range
Dim xRgUni As Range
Dim xFirstAddress As String
Dim xStr As String
On Error Resume Next
xStr = "MAPprice"
Set xRg = Range("A1:P1").Find(xStr, , xlValues, xlWhole, , , True)
If Not xRg Is Nothing Then
xFirstAddress = xRg.Address
Do
Set xRg = Range("A1:P1").FindNext(xRg)
If xRgUni Is Nothing Then
Set xRgUni = xRg
Else
Set xRgUni = Application.Union(xRgUni, xRg)
End If
Loop While (Not xRg Is Nothing) And (xRg.Address <> xFirstAddress)
End If
xRgUni.EntireColumn.Select
End Sub
Steve