Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill series in visible cells only

Can any one suggest a way to fill only the visible cells in a filtere
range with a numerical series. I'm dealing with a data base for tissu
culture where after filtering the rows the filtered group are assigne
new experimental numbers the simplest being 1 - 96 but this serie
needs to skip all the filtered rows.

I think I need a VBA macro but don't know the programming language.
guess a macro needs to loop through the cells assesing their propert
for visibility or not and incrementing their value as appropriate

Thanks Ros

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default Fill series in visible cells only

Select the range and run this:-

Sub DataSeries()

Dim Start As Long
Dim Incr As Long
Dim cel As Range
Dim rng As Range

Set rng = selection.SpecialCells(xlCellTypeVisible)

Start = InputBox("What is the start value of your number series")
Incr = InputBox("What is the incremental value you wish to use")

For Each cel In rng
cel.Value = Start
Start = Start + Incr
Next cel

End Sub


--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"RossM " wrote in message
...
Can any one suggest a way to fill only the visible cells in a filtered
range with a numerical series. I'm dealing with a data base for tissue
culture where after filtering the rows the filtered group are assigned
new experimental numbers the simplest being 1 - 96 but this series
needs to skip all the filtered rows.

I think I need a VBA macro but don't know the programming language. I
guess a macro needs to loop through the cells assesing their property
for visibility or not and incrementing their value as appropriate

Thanks Ross


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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.714 / Virus Database: 470 - Release Date: 02/07/2004


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill series in visible cells only

Thanks for the macro it works very well - very elegant

One question

Why does the macro know that cel is the first cell in rng and only on
cell this doesn't seem to be defined anywhere in the code?
Regards
Ros

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

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
Fill down visible cells only Stefi Excel Discussion (Misc queries) 6 April 7th 23 12:15 PM
exclude certain cells from series fill Doug Excel Worksheet Functions 1 January 27th 10 07:33 PM
How fill cells with alpha series? inicholi Excel Discussion (Misc queries) 3 July 27th 09 07:29 AM
How to fill cells with a different kind of series? Jared Excel Worksheet Functions 1 July 27th 06 12:37 AM
how do i fill down a series of linked cells barry Excel Discussion (Misc queries) 7 July 5th 06 10:50 PM


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