Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can i autofill cells

How can i autofill cells, with the textstring above it?
When a cell is blank fill it with the value above it.
When a cell is filled, goto next cell.

Thanks
Taco
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can i autofill cells

Sub test()
Dim allcells As Range, cell As Range
For Each cell In Range("a2:a100") 'a1 = error :)
If cell.Value = "" Then
cell.Value = cell.Offset(-1, 0).Value
End If
Next
End Sub

acces


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How can i autofill cells

On Error Resume Next
set rng = columns(1).specialcells(xlBlanks)
On Error goto 0
if not rng is nothing then
set rng.formula = "=" & rng(1).offset(-1,0).Address(0,0)
for each cell in rng
rng.Formula = rng.Value
Next
End if
Assumes the first cell will not be blank.
--
Regards,
Tom Ogilvy

"Taco" wrote in message
...
How can i autofill cells, with the textstring above it?
When a cell is blank fill it with the value above it.
When a cell is filled, goto next cell.

Thanks
Taco



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 of single cells Dannie Excel Discussion (Misc queries) 2 October 20th 08 07:24 AM
I can't autofill cells in a column if blank cells in between SJ Excel Worksheet Functions 1 May 4th 08 01:27 AM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
autofill cells without a pattern? ryu Excel Discussion (Misc queries) 2 April 11th 05 01:31 PM
Autofill skipping cells Carla Bradley Excel Worksheet Functions 1 November 8th 04 06:20 PM


All times are GMT +1. The time now is 02:00 PM.

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"