Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Scanning Through Filtered Data

Hi,

I need to be able to compare (manually) 2 separate
workbooks. The first one contains a series of updates that
are reflected in the second workbook. To make my life
easier, I was Auto Filtering the 2 workbooks so I could
focus on small portions at any single time.

What I would like to do is to be able to write a short
macro (invoked by pressing a character) that changes the
font color of the selected entry in the second workbook,
removing any highlighting from the selected entry in the
first workbook, change the font color of the selected entry
in the first workbook, then select the next entry in the
first workbook.

I have the following code (WKBOOK_NAME is a public const
whose value is the name of the first workbook):

Public Sub NextSelection()
Dim wkBook As Workbook
Dim r As Range
Dim r2 As Range

Set wkBook = ActiveWorkbook
Workbooks(WKBOOK_NAME).Activate

Set r = Selection
With r
.Font.ColorIndex = 10
.Interior.ColorIndex = xlNone
End With

Set r2 = r.Resize(2).Offset(1, 0).Resize(1)
r2.Select
r2.Interior.ColorIndex = 6
r2.Interior.Pattern = xlSolid

wkBook.Activate

Set r = Selection
r.Font.ColorIndex = 10

End Sub

The problem that I'm having is that the statement:
Set r2 = r.Resize(2).Offset(1, 0).Resize(1)
doesn't point me to the next entry in the filtered data,
but the next entry in the workbook (the entry filtered
entry could occur many rows later).

Any ideas on how to change this ??

Thanks for any help !!

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Scanning Through Filtered Data

I was able to kludge this by checking to see if the row
that the entry is in is hidden.

If anyone has any other ideas though, please let me know.

Thanks.

Michael


-----Original Message-----
Hi,

I need to be able to compare (manually) 2 separate
workbooks. The first one contains a series of updates

that
are reflected in the second workbook. To make my life
easier, I was Auto Filtering the 2 workbooks so I could
focus on small portions at any single time.

What I would like to do is to be able to write a short
macro (invoked by pressing a character) that changes the
font color of the selected entry in the second workbook,
removing any highlighting from the selected entry in the
first workbook, change the font color of the selected

entry
in the first workbook, then select the next entry in the
first workbook.

I have the following code (WKBOOK_NAME is a public const
whose value is the name of the first workbook):

Public Sub NextSelection()
Dim wkBook As Workbook
Dim r As Range
Dim r2 As Range

Set wkBook = ActiveWorkbook
Workbooks(WKBOOK_NAME).Activate

Set r = Selection
With r
.Font.ColorIndex = 10
.Interior.ColorIndex = xlNone
End With

Set r2 = r.Resize(2).Offset(1, 0).Resize(1)
r2.Select
r2.Interior.ColorIndex = 6
r2.Interior.Pattern = xlSolid

wkBook.Activate

Set r = Selection
r.Font.ColorIndex = 10

End Sub

The problem that I'm having is that the statement:
Set r2 = r.Resize(2).Offset(1, 0).Resize(1)
doesn't point me to the next entry in the filtered data,
but the next entry in the workbook (the entry filtered
entry could occur many rows later).

Any ideas on how to change this ??

Thanks for any help !!

Michael
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scanning data in Excel 2007 Charles Eaves[_3_] New Users to Excel 1 March 13th 10 04:57 PM
scanning worksheet for data then adding it Steve Excel Worksheet Functions 4 August 19th 07 06:36 PM
brinnging data to excel via scanning a sheet. saqi New Users to Excel 3 March 28th 07 12:03 AM
INDEX and Scanning a Data Set in Excel Bryan Excel Worksheet Functions 3 February 5th 07 03:34 PM
Scanning for Duplicate Data in a Column, Merging Data and Finally Removing All Duplicates...? : VB : Excel Programming 2 August 24th 03 02:22 PM


All times are GMT +1. The time now is 02:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"