View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default IF/THEN/ELSE for sequential numbers

Juggler,

I'm not sure what you mean by output but the code below takes a range of
numbers and appends an A and a B to each in the 2 columns to the right.

Sub addanAorB()
Dim myRange As Range
Set myRange = Range("A1:A10")
For Each c In myRange
c.Select
ActiveCell.Offset(0, 1).Value = c.Value & "A"
ActiveCell.Offset(0, 2).Value = c.Value & "B"
Next
End Sub

Mike

"juggler" wrote:

I have a series of sequential numbers that I want to output as two
parts of a whole component.

Example: 1, 2, 3, 4, 5, 6, etc would become 1A, 1B, 2A, 2B, 3A, 3B,
etc.

I was thinking of assigning odd/even for A/B, but then I come out with
1A, 2B, 3A, 4B, etc. With 20 or more numbers it becomes even more
unwieldy.

Suggestions?