Thread
:
help with generating a percentage value
View Single Post
#
1
Posted to microsoft.public.excel.programming
Claus Busch
external usenet poster
Posts: 3,872
help with generating a percentage value
Hi John,
Am Tue, 13 Mar 2012 05:38:07 -0700 (PDT) schrieb
:
the code loops through the cells picking up the values and adding a
percentage, until it comes to the end of the list
every third column is empty? Then try:
Dim LCol As Long
Dim i As Long
LCol = Cells(9, Columns.Count).End(xlToLeft).Column + 1
For i = 9 To LCol Step 3
Cells(9, i) = Cells(9, i - 1) / Cells(9, i - 2) * 100
Next
or:
Dim LCol As Long
Dim i As Long
LCol = Cells(9, Columns.Count).End(xlToLeft).Column + 1
For i = 9 To LCol Step 3
Cells(9, i) = Cells(9, i - 1) / Cells(9, i - 2)
Cells(9, i).NumberFormat = "0.00%"
Next
Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
Reply With Quote
Claus Busch
View Public Profile
Find all posts by Claus Busch