Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro question

Hi there,

I have two column look like this

A 1
2
3
4
B 1
2
C 1
2
3
D 1
2
And I want it to be

A 1
A 2
A 3
A 4
B 1
B 2
C 1
C 2
C 3
D 1
D 2
Another word to fill the empty space with the above letter
It always start with some letter and number at the top

Thanks,
Oded Dror




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Macro question

Hi

Try this:

Sub FillIn()
Dim LetterCol As String
Dim NumCol As String
Dim FirstRow As Long
Dim LastRow As Long

LetterCol = "A"
NumCol = "B"
FirstRow = 1
LastRow = Cells(FirstRow, NumCol).End(xlDown).Row

For r = FirstRow To LastRow
If Cells(r, LetterCol).Value < "" Then
FillLetter = Cells(r, LetterCol)
Else
Cells(r, LetterCol).Value = FillLetter
End If
Next
End Sub

Regards,
Per

"Oded Dror" skrev i meddelelsen
...
Hi there,

I have two column look like this

A 1
2
3
4
B 1
2
C 1
2
3
D 1
2
And I want it to be

A 1
A 2
A 3
A 4
B 1
B 2
C 1
C 2
C 3
D 1
D 2
Another word to fill the empty space with the above letter
It always start with some letter and number at the top

Thanks,
Oded Dror




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro question

Debra Dalgleish shares some techniques (manually and via code) he

http://contextures.com/xlDataEntry02.html
http://www.contextures.com/xlVideos01.html#FillBlanks



Oded Dror wrote:

Hi there,

I have two column look like this

A 1
2
3
4
B 1
2
C 1
2
3
D 1
2
And I want it to be

A 1
A 2
A 3
A 4
B 1
B 2
C 1
C 2
C 3
D 1
D 2
Another word to fill the empty space with the above letter
It always start with some letter and number at the top

Thanks,
Oded Dror



--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro question

Thack you all very mutch

"Oded Dror" wrote in message
...
Hi there,

I have two column look like this

A 1
2
3
4
B 1
2
C 1
2
3
D 1
2
And I want it to be

A 1
A 2
A 3
A 4
B 1
B 2
C 1
C 2
C 3
D 1
D 2
Another word to fill the empty space with the above letter
It always start with some letter and number at the top

Thanks,
Oded Dror




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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro Question ALoecher Excel Programming 4 June 9th 06 09:11 PM
question about the macro vb some one help? nader Excel Programming 3 July 31st 04 01:35 AM
macro question wooo Excel Programming 1 June 27th 04 01:30 PM
macro question scott23 Excel Programming 1 March 3rd 04 06:06 PM


All times are GMT +1. The time now is 03:08 AM.

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"