ExcelR00ki3
New Member
- Joined
- Jan 21, 2015
- Messages
- 7
Hi Excel/VBA Superusers!
Hoping someone out there might be able to help me.
I've been trawling through the forums hoping to find some help on how to write my VBA code (i've not written code for over a year ) but have had no luck finding anything that resembles what I'm trying to do.
Here is an example of my data (this is only a snippet. The actual table has the potential to be over 1000 rows long):
[table="width: 500, class: grid"]
[tr]
[td]Title[/td]
[td]APN[/td]
[td]Price[/td]
[td]Ranged[/td]
[/tr]
[tr]
[td]Test 1[/td]
[td]9000000000000[/td]
[td]9.95[/td]
[td]Y[/td]
[/tr]
[tr]
[td]Test 2[/td]
[td]9000000000001[/td]
[td]10.00[/td]
[td]N[/td]
[/tr]
[tr]
[td]Test 3[/td]
[td]9000000000002[/td]
[td]10.95[/td]
[td]Y[/td]
[/tr]
[tr]
[td]Test 4[/td]
[td]900000000003[/td]
[td]12.00[/td]
[td]N[/td]
[/tr]
[/table]
Basically, what I need the code to do is in Sheet1, go through the "Ranged" column, and for everytime a "Y" appears, copy the corresponding "Title" and paste it into a new table in Sheet2.
ie my expected output would be:
[table="width: 100, class: grid"]
[tr]
[td]TITLE[/td]
[/tr]
[tr]
[td]Test 1[/td]
[/tr]
[tr]
[td]Test 3[/td]
[/tr]
[/table]
Ideally, I'd copy the whole row but I thought that if I can just get the titles, I can vlookup/index, match the rest of the information in the actual spreadsheet. I know that this would contain a loop within a loop (potentially 3?) and would be based on an IF statement, but for the life of me, I can't think of how this would work.
If you could take the time to help, it would be very much appreciated.
Thanks
Kate
Hoping someone out there might be able to help me.
I've been trawling through the forums hoping to find some help on how to write my VBA code (i've not written code for over a year ) but have had no luck finding anything that resembles what I'm trying to do.
Here is an example of my data (this is only a snippet. The actual table has the potential to be over 1000 rows long):
[table="width: 500, class: grid"]
[tr]
[td]Title[/td]
[td]APN[/td]
[td]Price[/td]
[td]Ranged[/td]
[/tr]
[tr]
[td]Test 1[/td]
[td]9000000000000[/td]
[td]9.95[/td]
[td]Y[/td]
[/tr]
[tr]
[td]Test 2[/td]
[td]9000000000001[/td]
[td]10.00[/td]
[td]N[/td]
[/tr]
[tr]
[td]Test 3[/td]
[td]9000000000002[/td]
[td]10.95[/td]
[td]Y[/td]
[/tr]
[tr]
[td]Test 4[/td]
[td]900000000003[/td]
[td]12.00[/td]
[td]N[/td]
[/tr]
[/table]
Basically, what I need the code to do is in Sheet1, go through the "Ranged" column, and for everytime a "Y" appears, copy the corresponding "Title" and paste it into a new table in Sheet2.
ie my expected output would be:
[table="width: 100, class: grid"]
[tr]
[td]TITLE[/td]
[/tr]
[tr]
[td]Test 1[/td]
[/tr]
[tr]
[td]Test 3[/td]
[/tr]
[/table]
Ideally, I'd copy the whole row but I thought that if I can just get the titles, I can vlookup/index, match the rest of the information in the actual spreadsheet. I know that this would contain a loop within a loop (potentially 3?) and would be based on an IF statement, but for the life of me, I can't think of how this would work.
If you could take the time to help, it would be very much appreciated.
Thanks
Kate