Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba copy number to Column as letter ' B '
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba copy number to Column as letter ' B '
Thanks a million. The code is very concise.
Works very Well. Thanks again |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba copy number to Column as letter ' B '
You're very welcome. Thanks for the feedback.
"smandula" wrote in message ups.com... Thanks a million. The code is very concise. Works very Well. Thanks again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I turn excel columns from column number to column letter? | Setting up and Configuration of Excel | |||
column header changed from letter to number, how return to letter | Excel Discussion (Misc queries) | |||
Auto number w/ different letter-number combos in same column | Excel Worksheet Functions | |||
Column Number/Letter | Excel Programming | |||
Column Number to letter in Row Source | Excel Programming |