Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hide by autofilter vba

Posted on 2013-01-20
7
Medium Priority
?
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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 2000 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

730 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