The Power Loon
New Member
- Joined
- Feb 7, 2020
- Messages
- 34
- Office Version
- 365
- Platform
- Windows
I have a VBA codes that pulls dozens of different categories of data, based on filters, from various columns in a source table in one sheet and then pastes them all into column C in another sheet. My issue is that once pasted into column C, it's impossible to distinguish which category the data belongs to. There are no corresponding designations in the source data I can paste with it, and the amount of data pasted varies.
What I'm trying to do is add a line in the VBA code, immediately after each pasting action, that will add a designation into column A aligning with the just pasted values. I've tried some offsets, but just can't get it figured out. Below is a sample of code for one of the filters. Is this possible?
ActiveSheet.ListObjects("Table4").Range.AutoFilter Field:=12, Criteria1:= _
">=.001", Operator:=xlAnd
Range("Table4[1st to 2nd]").Select
Range("B5").Activate
Selection.Copy
Sheets("Records").Select
Range("C1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Add "Filter Set 1" to Column A in the corresponding row of each newly pasted value.
Sheets("All Combinations").Select
ActiveSheet.ListObjects("Table4").Range.AutoFilter Field:=12
What I'm trying to do is add a line in the VBA code, immediately after each pasting action, that will add a designation into column A aligning with the just pasted values. I've tried some offsets, but just can't get it figured out. Below is a sample of code for one of the filters. Is this possible?
ActiveSheet.ListObjects("Table4").Range.AutoFilter Field:=12, Criteria1:= _
">=.001", Operator:=xlAnd
Range("Table4[1st to 2nd]").Select
Range("B5").Activate
Selection.Copy
Sheets("Records").Select
Range("C1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Add "Filter Set 1" to Column A in the corresponding row of each newly pasted value.
Sheets("All Combinations").Select
ActiveSheet.ListObjects("Table4").Range.AutoFilter Field:=12