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 & Filter in VBA

Hello,

I have a Worksheet with some data, that i need to filter,
and after that fill one column from 1 to the number or
rows visibles.

Thanks for any help.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Fill & Filter in VBA

With your data table (a sample in B2:D10 (Including headers in Row2)) -
Column A empty:
Place in a Standard Module

Sub test()
counter = 1
rw = 3 ' <<< refers to row number of your 1st row
of your actual data
While ActiveSheet.Cells(rw, 2).Value < ""
If ActiveSheet.Rows(rw).Hidden = True Then
ActiveSheet.Cells(rw, 1).Value = 0
Else
ActiveSheet.Cells(rw, 1).Value = counter
counter = counter + 1
End If
rw = rw + 1
Wend
Columns("A:A").Select ' << This is the Column you want the row seq
entered
Selection.NumberFormat = "General"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With
MsgBox ("Done")
End Sub

Change ranges accordingly..
HTH

"Jorge Mario Casasola Salguero" wrote in message
...
Hello,

I have a Worksheet with some data, that i need to filter,
and after that fill one column from 1 to the number or
rows visibles.

Thanks for any help.








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
How do I filter the cells based in Fill color? Ravi Excel Discussion (Misc queries) 2 April 28th 10 12:47 PM
Skip Rows in Fill Series and Filter to Two different sheets Benjamin Excel Worksheet Functions 3 June 30th 09 12:58 AM
ID and/or filter rows with 'Fill Color' TOMB Excel Worksheet Functions 2 July 24th 07 05:14 PM
I need a specific value in auto filter to fill a combo box and than match the select value in 2 other columns. Marc Excel Worksheet Functions 0 May 22nd 06 08:41 PM
Select or Filter by Fill Color Wil Excel Worksheet Functions 1 November 4th 04 10:03 PM


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