Looking for some help trying to create a macro that could complete the following example (Each row is a row in Excel, and each large spacing is a column):
Going from...
IDxxxxx Region 1xxxxx Region 2xxxxx Region 3xxxxx Channel 1xxxxx Channel 2
1xxxxxxxx XxxxxxxxxxxxxxxxxxxxxxxxxxxxXxXxxxxxxxxxxxxXxxxxxxxxxxxxx X
To this...
IDxxxxx Regionxxxxx Channel
1xxxxxx Region 1xxxxxChannel 1
1xxxxxx Region 1xxxxxChannel 2
1xxxxxx Region 3xxxxxChannel 1
1xxxxxx Region 3xxxxxChannel 2
Any assistance would be greatly appreciated.
Thanks,
Last edited by JohnTait31490; 12-16-2010 at 05:25 PM.
The following macro will drop the results into coulmns H to J.
Sub Test() For N = 2 To Cells(Rows.Count, 1).End(xlUp).Row For R = 2 To 4 If Cells(N, R) = "X" Then For C = 5 To 6 If Cells(N, C) = "X" Then Cells(Rows.Count, 8).End(xlUp).Offset(1, 0) = Cells(N, 1) Cells(Rows.Count, 8).End(xlUp).Offset(0, 1) = Cells(1, R) Cells(Rows.Count, 8).End(xlUp).Offset(0, 2) = Cells(1, C) End If Next C End If Next R Next N End Sub
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
Example attached.
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks