Excel Macros>Functions
Closed
Chris
-
Oct 26, 2011 at 06:13 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 27, 2011 at 10:45 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 27, 2011 at 10:45 PM
Related:
- Excel Macros>Functions
- Macros in excel download free - Download - Spreadsheets
- Excel mod apk for pc - Download - Spreadsheets
- Number to words in excel - Guide
- Excel marksheet - Guide
- Kernel for excel - Download - Backup and recovery
2 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Oct 26, 2011 at 09:35 PM
Oct 26, 2011 at 09:35 PM
"if one new sheet could pull any info with A22 and the other with A35 in column C"
what is connection with A22 and A35
what is meant by "A35 in column C". A35 is intersection of row 35 and column A. do you mean intersection of row 35 and column C.
preferably post a small extract of your data
what is connection with A22 and A35
what is meant by "A35 in column C". A35 is intersection of row 35 and column A. do you mean intersection of row 35 and column C.
preferably post a small extract of your data
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Oct 27, 2011 at 10:45 PM
Oct 27, 2011 at 10:45 PM
suppose sample data in sheet 1 is like this. the required company% A22 and A35 are colored yellow only for identification purposes. you can remove the color
HDNG1 HDNG2 HDNG3 HDNG4
39 36 B1 81
25 20 B2 39
2 32 B3 38
8 61 A22 43
19 45 B4 85
49 16 B5 88
99 53 A35 2
71 38 B7 3
75 44 B8 33
now try this macro and see sheet2
every time you add data run the macro . if you want automatic then do an event code under workbook_close event and under this type the name of the macro. so every time you close the file the macro will be run
HDNG1 HDNG2 HDNG3 HDNG4
39 36 B1 81
25 20 B2 39
2 32 B3 38
8 61 A22 43
19 45 B4 85
49 16 B5 88
99 53 A35 2
71 38 B7 3
75 44 B8 33
now try this macro and see sheet2
Sub test() Dim r As Range, filt As Range Worksheets("sheet2").Cells.Clear With Worksheets("sheet1") Set r = .Range("A1").CurrentRegion r.AutoFilter Range("C1").Column, "A22", xlOr, "A35" Set filt = r.Offset(1, 0).Resize(Rows.Count - 1, Columns.Count).SpecialCells(xlCellTypeVisible) filt.Copy With Worksheets("sheet2") .Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial End With r.AutoFilter End With End Sub
every time you add data run the macro . if you want automatic then do an event code under workbook_close event and under this type the name of the macro. so every time you close the file the macro will be run
Oct 27, 2011 at 10:26 AM
"A22" and "A35" are company #s (not a cell reference), so my 200+ rows of data would contain either an "A22" or "A35" in column C.