Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Repeat the contents of a cell

Hi group,



I want to repeat the contents of a cell to all cells below in the column
provided the cells below are blank.

This operation shall continue until a cell with contents is met. After this
the repetition to all new blanks shall continue with the contents of the new
cell.

Moreover, I want to specify the range in which I want the procedure to work.



I hope someone can help.



Regards

Kaj Pedersen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Repeat the contents of a cell

One way. Modify to suit.

Sub fillempties()
For Each c In [k1:k12]
If c = "" Then c.Value = c.Offset(-1)
Next
End Sub

"Kaj Pedersen" wrote in message
...
Hi group,



I want to repeat the contents of a cell to all cells below in the column
provided the cells below are blank.

This operation shall continue until a cell with contents is met. After

this
the repetition to all new blanks shall continue with the contents of the

new
cell.

Moreover, I want to specify the range in which I want the procedure to

work.



I hope someone can help.



Regards

Kaj Pedersen




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Repeat the contents of a cell


Hi Kaj,

select the range and run this macro

Sub fill_empty_cells()
Selection.SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C"
Selection.Copy
Selection.PasteSpecial xlPasteValues
End Sub


Wolf
wlamik<atgmx.net<nospam
-----Original Message-----
Hi group,



I want to repeat the contents of a cell to all cells

below in the column
provided the cells below are blank.

This operation shall continue until a cell with contents

is met. After this
the repetition to all new blanks shall continue with the

contents of the new
cell.

Moreover, I want to specify the range in which I want the

procedure to work.



I hope someone can help.



Regards

Kaj Pedersen


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Repeat the contents of a cell


Hi,
Thanks to both of you for your inputs.

Regards
Kaj Pedersen


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Repeat the contents of a cell

Better than my offering but this might be a little shorter & quicker than
copy/paste

Sub fill_empty_cells1()
With Selection
.SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C"
.Formula = .Value
End With
End Sub

"wolf" wrote in message
...

Hi Kaj,

select the range and run this macro

Sub fill_empty_cells()
Selection.SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C"
Selection.Copy
Selection.PasteSpecial xlPasteValues
End Sub


Wolf
wlamik<atgmx.net<nospam
-----Original Message-----
Hi group,



I want to repeat the contents of a cell to all cells

below in the column
provided the cells below are blank.

This operation shall continue until a cell with contents

is met. After this
the repetition to all new blanks shall continue with the

contents of the new
cell.

Moreover, I want to specify the range in which I want the

procedure to work.



I hope someone can help.



Regards

Kaj Pedersen


.



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
concatenate contents of cells whose contents resemble cell referem cathyh Excel Worksheet Functions 3 May 23rd 09 12:16 PM
nested Cell("contents", w/ cell contents reference) JASelep Excel Worksheet Functions 1 October 19th 07 12:17 AM
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec unibaby Excel Discussion (Misc queries) 2 August 24th 05 04:29 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Cell contents vs. Formula contents Sarah Excel Discussion (Misc queries) 3 December 15th 04 06:02 PM


All times are GMT +1. The time now is 08:24 PM.

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

About Us

"It's about Microsoft Excel"