Hello,
I'm new to the VBA side of things. I want to select a range of cells and
for each cell in that selection, divide it by the value that is in row1 of
the same column, and return that value to the cell. (I'm converting a number
to a percent by dividing current number by total number, which is kept in row
1, same column.) I have some of the code, but don't know how to represent
the value of row 1, same column. Can someone please assist? thanks - Russ
Sub ConvertHoursToPercent()
Dim Cell As Range
For Each Cell In Selection
If IsNumeric(Cell.Value) Then Cell.Value =
Next Cell
End Sub
Bob Phillips - 15 Jun 2007 14:19 GMT
Sub ConvertHoursToPercent()
Dim Cell As Range
For Each Cell In Selection
If IsNumeric(Cell.Value) Then
Cell.Value = Cell.Value / Cells(Cell.Row,1).Value
End If
Next Cell
End Sub

Signature
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> Hello,
>
[quoted text clipped - 14 lines]
> Next Cell
> End Sub
xrbbaker - 15 Jun 2007 15:09 GMT
Thanks Bob. I still struggle with this stuff. I know what I want to do but
I can't figure out the whole object model relationship thing and browsing the
Object Model isn't helping me yet. I'm sure that just comes with time.
thx
> Sub ConvertHoursToPercent()
> Dim Cell As Range
[quoted text clipped - 23 lines]
> > Next Cell
> > End Sub