Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I filter the cells based in Fill color? | Excel Discussion (Misc queries) | |||
Skip Rows in Fill Series and Filter to Two different sheets | Excel Worksheet Functions | |||
ID and/or filter rows with 'Fill Color' | Excel Worksheet Functions | |||
I need a specific value in auto filter to fill a combo box and than match the select value in 2 other columns. | Excel Worksheet Functions | |||
Select or Filter by Fill Color | Excel Worksheet Functions |