PC Review


Reply
Thread Tools Rate Thread

Autofill cells in 1 column :code ??

 
 
Luc
Guest
Posts: n/a
 
      26th Feb 2007
Hello,


I want to do the following :

I have 1 column

Let's say the value in cell A1 is "APPLE"
Let's say the value in cell A15 is "PEACH"
Let's say the value in cell A19 is "BANANA"

The cells between these cells are empty.

Example :

A1 APPLE
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15 PEACH
A16
A17
A18
A19 BANANA
A20
.......

Now i want that the cells A2 to A14 contain the value of cell A1, in this
case "APPLE"
I want that the value in cells A16 to A18 contain the value of cell A15, in
this case "PEACH"
I want that the value in cells A19 to A... (the empty cell before the next
non empty cell in this column) contain the value of cell A19, in this case
"BANANA"

The result should be this :

A1 APPLE
A2 APPLE
A3 APPLE
A4 APPLE
A5 APPLE
A6 APPLE
A7 APPLE
A8 APPLE
A9 APPLE
A10 APPLE
A11 APPLE
A12 APPLE
A13 APPLE
A14 APPLE
A15 PEACH
A16 PEACH
A17 PEACH
A18 PEACH
A19 BANANA
A20 BANANA

Of course the row numbers int this example are fictional, they could be any
value.....

Can someone provide me with sompe code to do this.


Thanxxxxx

Luc



--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
314 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      26th Feb 2007
Debra Dalgleish shares some techniques:
http://contextures.com/xlDataEntry02.html

Luc wrote:
>
> Hello,
>
> I want to do the following :
>
> I have 1 column
>
> Let's say the value in cell A1 is "APPLE"
> Let's say the value in cell A15 is "PEACH"
> Let's say the value in cell A19 is "BANANA"
>
> The cells between these cells are empty.
>
> Example :
>
> A1 APPLE
> A2
> A3
> A4
> A5
> A6
> A7
> A8
> A9
> A10
> A11
> A12
> A13
> A14
> A15 PEACH
> A16
> A17
> A18
> A19 BANANA
> A20
> ......
>
> Now i want that the cells A2 to A14 contain the value of cell A1, in this
> case "APPLE"
> I want that the value in cells A16 to A18 contain the value of cell A15, in
> this case "PEACH"
> I want that the value in cells A19 to A... (the empty cell before the next
> non empty cell in this column) contain the value of cell A19, in this case
> "BANANA"
>
> The result should be this :
>
> A1 APPLE
> A2 APPLE
> A3 APPLE
> A4 APPLE
> A5 APPLE
> A6 APPLE
> A7 APPLE
> A8 APPLE
> A9 APPLE
> A10 APPLE
> A11 APPLE
> A12 APPLE
> A13 APPLE
> A14 APPLE
> A15 PEACH
> A16 PEACH
> A17 PEACH
> A18 PEACH
> A19 BANANA
> A20 BANANA
>
> Of course the row numbers int this example are fictional, they could be any
> value.....
>
> Can someone provide me with sompe code to do this.
>
> Thanxxxxx
>
> Luc
>
> --------------------------------------------------------------------------------
> Mijn Postvak In wordt beschermd door SPAMfighter
> 314 spam-mails zijn er tot op heden geblokkeerd.
> Download de gratis SPAMfighter vandaag nog!


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?ZGtpbm4=?=
Guest
Posts: n/a
 
      26th Feb 2007
you didn't say how far down you wanted to go (all the way to 65,000 rows or
1,000,000 rows?) so here is something you can set limts on

Sub test()
'1 can be changed to any starting row number
'500 can be changed to any ending row number
For cnt = 1 To 500
If IsEmpty(Cells(cnt + 1, 1)) Then
Cells(cnt + 1, 1).Value = Cells(cnt, 1)
End If

Next cnt

End Sub

hope this gives you a starting point

David

"Luc" wrote:

> Hello,
>
>
> I want to do the following :
>
> I have 1 column
>
> Let's say the value in cell A1 is "APPLE"
> Let's say the value in cell A15 is "PEACH"
> Let's say the value in cell A19 is "BANANA"
>
> The cells between these cells are empty.
>
> Example :
>
> A1 APPLE
> A2
> A3
> A4
> A5
> A6
> A7
> A8
> A9
> A10
> A11
> A12
> A13
> A14
> A15 PEACH
> A16
> A17
> A18
> A19 BANANA
> A20
> .......
>
> Now i want that the cells A2 to A14 contain the value of cell A1, in this
> case "APPLE"
> I want that the value in cells A16 to A18 contain the value of cell A15, in
> this case "PEACH"
> I want that the value in cells A19 to A... (the empty cell before the next
> non empty cell in this column) contain the value of cell A19, in this case
> "BANANA"
>
> The result should be this :
>
> A1 APPLE
> A2 APPLE
> A3 APPLE
> A4 APPLE
> A5 APPLE
> A6 APPLE
> A7 APPLE
> A8 APPLE
> A9 APPLE
> A10 APPLE
> A11 APPLE
> A12 APPLE
> A13 APPLE
> A14 APPLE
> A15 PEACH
> A16 PEACH
> A17 PEACH
> A18 PEACH
> A19 BANANA
> A20 BANANA
>
> Of course the row numbers int this example are fictional, they could be any
> value.....
>
> Can someone provide me with sompe code to do this.
>
>
> Thanxxxxx
>
> Luc
>
>
>
> --------------------------------------------------------------------------------
> Mijn Postvak In wordt beschermd door SPAMfighter
> 314 spam-mails zijn er tot op heden geblokkeerd.
> Download de gratis SPAMfighter vandaag nog!
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill column from data (code) in column next to it Matt Microsoft Excel Worksheet Functions 4 24th Apr 2009 06:17 PM
I can't autofill cells in a column if blank cells in between SJ Microsoft Excel Worksheet Functions 1 4th May 2008 01:27 AM
how to autofill a consecutive cells in a column? =?Utf-8?B?ZGlhYmxvOQ==?= Microsoft Excel Worksheet Functions 3 25th Apr 2007 12:02 AM
how to autofill a consecutive cells in a column? =?Utf-8?B?ZGlhYmxvOQ==?= Microsoft Excel Misc 1 24th Apr 2007 09:47 PM
how to autofill a consecutive cells in a column? =?Utf-8?B?ZGlhYmxvOQ==?= Microsoft Excel Programming 1 24th Apr 2007 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:09 AM.