Excel macro question
Closed
nzstorm
Posts
6
Registration date
Thursday December 8, 2011
Status
Member
Last seen
February 3, 2013
-
Dec 8, 2011 at 08:53 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Dec 9, 2011 at 10:33 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Dec 9, 2011 at 10:33 AM
Related:
- Excel macro question
- Spell number in excel without macro - Guide
- Excel marksheet - Guide
- Excel apk for pc - Download - Spreadsheets
- Macros in excel download free - Download - Spreadsheets
- Kernel for excel - Download - Backup and recovery
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Dec 9, 2011 at 05:49 AM
Dec 9, 2011 at 05:49 AM
This is how I would approach
1. obtain the date to be searched
2. loop thru each sheet
3. test if the sheet being looped is not the sheet where the results are to be copied. If yes, then loop to next search
4. filter each sheet for the date entered
5. if number of visible row is more than 1, then copy the visible rows and paste to the sheet
1. obtain the date to be searched
2. loop thru each sheet
3. test if the sheet being looped is not the sheet where the results are to be copied. If yes, then loop to next search
4. filter each sheet for the date entered
5. if number of visible row is more than 1, then copy the visible rows and paste to the sheet
nzstorm
Posts
6
Registration date
Thursday December 8, 2011
Status
Member
Last seen
February 3, 2013
Dec 9, 2011 at 09:05 AM
Dec 9, 2011 at 09:05 AM
I should've mentioned that I am still a novice at writing macros. I can try to figure out how to do the first three steps. As far as step 4 and 5, what functions would you use to accomplish that?
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Dec 9, 2011 at 10:33 AM
Dec 9, 2011 at 10:33 AM
Kind of surprised that you would find step 3 easier than step 4 :).
To see the code for filter, you could have used macro recorder. Only thing you have to keep an eye open is for date format. I think you would need to enter the date in same format as the date int he column for the filter to work
for item 5:
lLastUsedRow = cells(rows.count, "A").end(xlup).row
if (lLastRow > 1) then
' ok i have more than one row
end if
To see the code for filter, you could have used macro recorder. Only thing you have to keep an eye open is for date format. I think you would need to enter the date in same format as the date int he column for the filter to work
for item 5:
lLastUsedRow = cells(rows.count, "A").end(xlup).row
if (lLastRow > 1) then
' ok i have more than one row
end if