View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default vba copy number to Column as letter ' B '

Sub BonusNumber()
Dim cell As Range
Dim lRow As Long
Dim lColumn As Long
Application.ScreenUpdating = False
For Each cell In _
Range("J1:J" & _
Range("J65536").End(xlUp).Row)
lRow = cell.Row
lColumn = cell.Value
Cells(lRow, lColumn) = "B"
Next 'cell
Application.ScreenUpdating = True
End Sub

"smandula" wrote in message
oups.com...
Can anyone suggest a VBA macro in copying a number found in Column J
say,
that number for that row is 5. Copy that number to Column 'E' (which is
the
fifth column, not the number 5 but the letter ' B '. Then proceed down
to
the next row in Column J which number is 1; copy number 1,then change
to 'B' in column A. Do this until there are no more numbers in Column
J.

Background, Column J is the Bonus number in a lottery. This number
is copied to the appropriate column as 'B'. Doing this all the while in
VBA.

With thanks