Solved

Hide by autofilter vba

Posted on 2013-01-20
7
262 Views
Last Modified: 2013-01-20
Guys, please see the attached file.

It is an overtime calculation spreadsheet. Overtime criteria is row "F". When the hide button is clicked and if a cell in row "F" = 0 the autofilter hides those rows. The hide action is triggered if info in row "H">0.
I would like the code to go to the top visible cell in row "I" after the hide button is clicked.
For the attached scenario when the hide button is clicked the code should go to "I8", not "I5", the actual top open cell.

Thank you in advance for the direction with this code.

Robert
next-row.xlsm
0
Comment
Question by:rws1
  • 3
  • 3
7 Comments
 
LVL 10

Expert Comment

by:Anthony Berenguel
ID: 38798700
Hi Robert,

See the attached spreadsheet for an example of how to do this. Let me know if you have questions.

Regards,

AB
next-row.xlsm
0
 

Author Comment

by:rws1
ID: 38798733
AB, thank you for your response, your code is great from the module activation.

I have 7 simialar filters, do I need to copy; Public Sub Select_Top_Visible_Cell() for each action;
such as
Public Sub Select_Top_Visible_Cell()
Public Sub Select_Top_Visible_Cell1()
Public Sub Select_Top_Visible_Cell2()
And so forth or do you see a common denominator for all 7 filters?

Thank you again for your help,
Robert
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38798743
You do not need a loop. Try

 Sheet1.AutoFilter.Range.Offset(, 1).SpecialCells(xlCellTypeVisible).Cells(1).Select
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:rws1
ID: 38798758
Thank you for your response, where would the code you sent be place in the editor?  

Sheet1.AutoFilter.Range.Offset(, 1).SpecialCells(xlCellTypeVisible).Cells(1).Select
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38798762
In place of the

.... I5 ...select

line
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38798771
Here is the file with the line inserted
Copy-of-next-row.xlsm
0
 

Author Comment

by:rws1
ID: 38798791
ssaqibh, thank you it works great
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now