Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default vba copy number to Column as letter ' B '

Thanks a million. The code is very concise.
Works very Well.

Thanks again

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I turn excel columns from column number to column letter? column Setting up and Configuration of Excel 1 April 29th 08 10:15 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM
Column Number/Letter david fixemer Excel Programming 3 February 18th 04 06:36 PM
Column Number to letter in Row Source John Wilson Excel Programming 10 December 6th 03 03:40 PM


All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"