Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Luc Luc is offline
external usenet poster
 
Posts: 23
Default Autofill cells in 1 column :code ??

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!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Autofill cells in 1 column :code ??

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Autofill cells in 1 column :code ??

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
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
Autofill column from data (code) in column next to it Matt Excel Worksheet Functions 4 April 24th 09 06:17 PM
I can't autofill cells in a column if blank cells in between SJ Excel Worksheet Functions 1 May 4th 08 01:27 AM
how to autofill a consecutive cells in a column? diablo9 Excel Worksheet Functions 3 April 25th 07 12:02 AM
how to autofill a consecutive cells in a column? diablo9 Excel Discussion (Misc queries) 1 April 24th 07 09:47 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM


All times are GMT +1. The time now is 12:00 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"