Retrieve multiple results from worksheets
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have workbook with multiple spreadsheets. I would like to be able to search through these workbooks to find multiple results.
In work book1 - Called numbers.
- I have column B headings as test names
- I have column c headings as alignment names
What I would like to be able to do using a formula in a new worksheet is create my alignment names as rows, then list all the test names that are assigned to that alignment name through my entire workbook
(I was not able to show in multiple tables, but each results would need to be in a new cell and the search would be across multiple workbooks.)

Hi,
Sample data in previous post.
I have written the code as follows:
Dim countColTracking As Integer
Dim countCol As Integer
Dim countRow As Integer
Dim colName As String
Dim Sheetname As String
Dim Stoploop As Boolean
Dim ws As Worksheet
Dim countSheetR As Integer
Dim WsName As String
For Each ws In ActiveWorkbook.Worksheets
Sheetname = ws.Name
countRow = 7
countColTracking = 2
If Sheetname <> "Sheet1" And Sheetname <> "Infotab" And Sheetname <> "Tracking Sheet" And Sheetname <> "Initialise" And Sheetname <> "ClassList" And Sheetname <> "Template" Then
While Sheets("Tracking Sheet").Cells(countRow, 1) <> ""
colName = Sheets("Tracking Sheet").Cells(countRow, 1)
countCol = 2
Stoploop = False
While Sheets(Sheetname).Cells(2, countCol) <> "Total" And Stoploop = False
WsName = Sheets(Sheetname).Cells(2, countCol)
If Sheets(Sheetname).Cells(4, countCol) = colName Then
Stoploop = True
End If
countCol = countCol + 1
Wend
If Stoploop = True Then 'Value is found - do something
Sheets("Tracking Sheet").Cells(countRow, countColTracking) = Sheets(Sheetname).Cells(2, countCol)
'countColTracking = countColTracking + 1
End If
countRow = countRow + 1
Wend
End If
Next
But now my loops are in the incorrect place. I retrieve Sm Pg8, but I should retrieve SMpg 7 as in the above layouts.
It then is still looping incorrectly in that it moves straight to the next column "Answer Questions", instead of moving to the next worksheet
Any ideas?
Thank you
The result should look like this:

microsoft-excel worksheet-function
add a comment |
I have workbook with multiple spreadsheets. I would like to be able to search through these workbooks to find multiple results.
In work book1 - Called numbers.
- I have column B headings as test names
- I have column c headings as alignment names
What I would like to be able to do using a formula in a new worksheet is create my alignment names as rows, then list all the test names that are assigned to that alignment name through my entire workbook
(I was not able to show in multiple tables, but each results would need to be in a new cell and the search would be across multiple workbooks.)

Hi,
Sample data in previous post.
I have written the code as follows:
Dim countColTracking As Integer
Dim countCol As Integer
Dim countRow As Integer
Dim colName As String
Dim Sheetname As String
Dim Stoploop As Boolean
Dim ws As Worksheet
Dim countSheetR As Integer
Dim WsName As String
For Each ws In ActiveWorkbook.Worksheets
Sheetname = ws.Name
countRow = 7
countColTracking = 2
If Sheetname <> "Sheet1" And Sheetname <> "Infotab" And Sheetname <> "Tracking Sheet" And Sheetname <> "Initialise" And Sheetname <> "ClassList" And Sheetname <> "Template" Then
While Sheets("Tracking Sheet").Cells(countRow, 1) <> ""
colName = Sheets("Tracking Sheet").Cells(countRow, 1)
countCol = 2
Stoploop = False
While Sheets(Sheetname).Cells(2, countCol) <> "Total" And Stoploop = False
WsName = Sheets(Sheetname).Cells(2, countCol)
If Sheets(Sheetname).Cells(4, countCol) = colName Then
Stoploop = True
End If
countCol = countCol + 1
Wend
If Stoploop = True Then 'Value is found - do something
Sheets("Tracking Sheet").Cells(countRow, countColTracking) = Sheets(Sheetname).Cells(2, countCol)
'countColTracking = countColTracking + 1
End If
countRow = countRow + 1
Wend
End If
Next
But now my loops are in the incorrect place. I retrieve Sm Pg8, but I should retrieve SMpg 7 as in the above layouts.
It then is still looping incorrectly in that it moves straight to the next column "Answer Questions", instead of moving to the next worksheet
Any ideas?
Thank you
The result should look like this:

microsoft-excel worksheet-function
Share some sample data, will help us to text the method !!
– Rajesh S
Mar 4 at 6:55
add a comment |
I have workbook with multiple spreadsheets. I would like to be able to search through these workbooks to find multiple results.
In work book1 - Called numbers.
- I have column B headings as test names
- I have column c headings as alignment names
What I would like to be able to do using a formula in a new worksheet is create my alignment names as rows, then list all the test names that are assigned to that alignment name through my entire workbook
(I was not able to show in multiple tables, but each results would need to be in a new cell and the search would be across multiple workbooks.)

Hi,
Sample data in previous post.
I have written the code as follows:
Dim countColTracking As Integer
Dim countCol As Integer
Dim countRow As Integer
Dim colName As String
Dim Sheetname As String
Dim Stoploop As Boolean
Dim ws As Worksheet
Dim countSheetR As Integer
Dim WsName As String
For Each ws In ActiveWorkbook.Worksheets
Sheetname = ws.Name
countRow = 7
countColTracking = 2
If Sheetname <> "Sheet1" And Sheetname <> "Infotab" And Sheetname <> "Tracking Sheet" And Sheetname <> "Initialise" And Sheetname <> "ClassList" And Sheetname <> "Template" Then
While Sheets("Tracking Sheet").Cells(countRow, 1) <> ""
colName = Sheets("Tracking Sheet").Cells(countRow, 1)
countCol = 2
Stoploop = False
While Sheets(Sheetname).Cells(2, countCol) <> "Total" And Stoploop = False
WsName = Sheets(Sheetname).Cells(2, countCol)
If Sheets(Sheetname).Cells(4, countCol) = colName Then
Stoploop = True
End If
countCol = countCol + 1
Wend
If Stoploop = True Then 'Value is found - do something
Sheets("Tracking Sheet").Cells(countRow, countColTracking) = Sheets(Sheetname).Cells(2, countCol)
'countColTracking = countColTracking + 1
End If
countRow = countRow + 1
Wend
End If
Next
But now my loops are in the incorrect place. I retrieve Sm Pg8, but I should retrieve SMpg 7 as in the above layouts.
It then is still looping incorrectly in that it moves straight to the next column "Answer Questions", instead of moving to the next worksheet
Any ideas?
Thank you
The result should look like this:

microsoft-excel worksheet-function
I have workbook with multiple spreadsheets. I would like to be able to search through these workbooks to find multiple results.
In work book1 - Called numbers.
- I have column B headings as test names
- I have column c headings as alignment names
What I would like to be able to do using a formula in a new worksheet is create my alignment names as rows, then list all the test names that are assigned to that alignment name through my entire workbook
(I was not able to show in multiple tables, but each results would need to be in a new cell and the search would be across multiple workbooks.)

Hi,
Sample data in previous post.
I have written the code as follows:
Dim countColTracking As Integer
Dim countCol As Integer
Dim countRow As Integer
Dim colName As String
Dim Sheetname As String
Dim Stoploop As Boolean
Dim ws As Worksheet
Dim countSheetR As Integer
Dim WsName As String
For Each ws In ActiveWorkbook.Worksheets
Sheetname = ws.Name
countRow = 7
countColTracking = 2
If Sheetname <> "Sheet1" And Sheetname <> "Infotab" And Sheetname <> "Tracking Sheet" And Sheetname <> "Initialise" And Sheetname <> "ClassList" And Sheetname <> "Template" Then
While Sheets("Tracking Sheet").Cells(countRow, 1) <> ""
colName = Sheets("Tracking Sheet").Cells(countRow, 1)
countCol = 2
Stoploop = False
While Sheets(Sheetname).Cells(2, countCol) <> "Total" And Stoploop = False
WsName = Sheets(Sheetname).Cells(2, countCol)
If Sheets(Sheetname).Cells(4, countCol) = colName Then
Stoploop = True
End If
countCol = countCol + 1
Wend
If Stoploop = True Then 'Value is found - do something
Sheets("Tracking Sheet").Cells(countRow, countColTracking) = Sheets(Sheetname).Cells(2, countCol)
'countColTracking = countColTracking + 1
End If
countRow = countRow + 1
Wend
End If
Next
But now my loops are in the incorrect place. I retrieve Sm Pg8, but I should retrieve SMpg 7 as in the above layouts.
It then is still looping incorrectly in that it moves straight to the next column "Answer Questions", instead of moving to the next worksheet
Any ideas?
Thank you
The result should look like this:

microsoft-excel worksheet-function
microsoft-excel worksheet-function
edited Mar 11 at 11:13
Jext
asked Mar 4 at 5:58
JextJext
11
11
Share some sample data, will help us to text the method !!
– Rajesh S
Mar 4 at 6:55
add a comment |
Share some sample data, will help us to text the method !!
– Rajesh S
Mar 4 at 6:55
Share some sample data, will help us to text the method !!
– Rajesh S
Mar 4 at 6:55
Share some sample data, will help us to text the method !!
– Rajesh S
Mar 4 at 6:55
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1411051%2fretrieve-multiple-results-from-worksheets%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1411051%2fretrieve-multiple-results-from-worksheets%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Share some sample data, will help us to text the method !!
– Rajesh S
Mar 4 at 6:55