Hi Excel Community!
I need some kind help with the following VBA code. If anyone can please help, this would be great! It's been challenging to define this.
Goal:
I need to adjust all values in certain columns based on specific headings across multiple sheets.
I will store and run the macro from my PERSONAL Macro WB.
My headings span cell range A1 to around DT, so I have just stated the max range as Range("A1:DZ1") for the headings.
Basically I need to multiply all the values in the column for certain headings across the sheets in a workboo iF the value is larger than 1.
The values I am working with are percentages.
However, for some reason, they are all multiplied by 10. For example, 78.24% is noted incorrectly in the column as 7824%. So I need to multiply all the percentages by 0.01 to obtain the actual %.
The headings have different names: Heading1, Heading2, .... Heading 99, and they are contained within different sheets in the workbook.
I have a list of all the column headings already written down, so I can copy that into the Macro in the appropriate section.
I have been trying to build the following code without much success:
Please let me know your thoughts and if anyone needs further information, please let me know. Thank you!
Manerlao
I need some kind help with the following VBA code. If anyone can please help, this would be great! It's been challenging to define this.
Goal:
I need to adjust all values in certain columns based on specific headings across multiple sheets.
I will store and run the macro from my PERSONAL Macro WB.
My headings span cell range A1 to around DT, so I have just stated the max range as Range("A1:DZ1") for the headings.
Basically I need to multiply all the values in the column for certain headings across the sheets in a workboo iF the value is larger than 1.
The values I am working with are percentages.
However, for some reason, they are all multiplied by 10. For example, 78.24% is noted incorrectly in the column as 7824%. So I need to multiply all the percentages by 0.01 to obtain the actual %.
The headings have different names: Heading1, Heading2, .... Heading 99, and they are contained within different sheets in the workbook.
I have a list of all the column headings already written down, so I can copy that into the Macro in the appropriate section.
I have been trying to build the following code without much success:
VBA Code:
Sub AdjustColValues()
'*******************
Dim Cell As Range, rngX As Range
Dim strFormat As String
Dim ws As Worksheet
'Headings are in cell range A1 a maximum of DZ1
Set rngX = Range("A1:DZ1")
For Each Cell In rngX
With Cell
Select Case True
Case .Value Like "Heading1" OR like "Heading2"
If Cell.Value > 1 Then
For Each Cell In EntireColumn.Cells
Cell.Value = Cell.Value * 0.01
Next Cell
Else
End If
End Select
End With
Next Cell
End Sub
Please let me know your thoughts and if anyone needs further information, please let me know. Thank you!
Manerlao