Active cell = visible cells

Status
Not open for further replies.

Lorlai

Board Regular
Joined
May 26, 2011
Messages
85
I have run filter through my data to make it smaller. However, when I run a loop
Code:
Do

ActiveCell.Offset(0, 1).Select

If IsEmpty(ActiveCell) Then
        ActiveCell.Offset(1, 0).Select
    ActiveSheet.Cells(ActiveCell.Row, 1).Select
    End If

Loop Until IsEmpty(ActiveCell)
This will loop through ALL of my data, not just my filtered data. Is there a way to make this so that the activecell will only become the visible filtered cell?


Thank you!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Your code doesn't really do anything (nothing useful anyway), especially noting that it's rarely ever necessary to Select anything, and it's horribly inefficient.

If you're trying to select the Visible cells after filtering you can use Goto (Ctrl+G)-->Special-->Visible Cells only.

Otherwise can you let us know what you're trying to do?
 
Upvote 0
That code was more of a test, what I am trying to do is explained in this post.

Basically I have two sheets that I comparing cell by cell, trying to find changes. My data is so large that my code breaks every-time I run through it. I am trying to reduce the amount of code by applying a filter. However, my code in the post still runs through EVERY cell, not just the visible ones.

Is there a way to just go through the cells I have made visible through the filters? This will reduce the data from 9300 rows to 800 (Much better!)
 
Upvote 0
Then please continue in your Original Post. That way everyone can see what got you to this point.

As for only working with visible cells look in the VB helpfile for the SpecialCells method.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top