Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default find matching cell in spread over two worksheets

Dear users,

My workbook contains two worksheets. One is my "database", the other
one is a sheet in which I filter my database (special filter).

Each row in my database is a special case with several cells of
information.

My colleagues will be using the filter to find specific cases filtered
by different criterias. Therefore, the result will always be a
different amount of rows.

To their comfort, I would like to offer them the possibility to change
the cell value right in the filter.

Each "case", when it is created, has in column "A" a case-number. This
number might not be identical with the row number.

My idea is the following:

I would like to offer a sub, which can be started by a Shortcut (I can
handle that, I guess). The Sub should do then the following:

- ActiveWorksheet: ActiveCell find out Column XYZ, find out Case-
Number on the same row in Column A
- In other Worksheet: Find matching Case-Number, in the same row, go
to Column XYZ (as in ActiveWorksheet) and copy Copy Value of
ActiveCell into this cell

Thanks a lot for your help.

If you can also help me to restrict the short-cut to work only in a
specific area like Worksheets("Name").Range("A8:AA1000"), I would be
very thankful.

Thank you very much to anybody who contributes to this post.

Sincerely,

Rico

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default find matching cell in spread over two worksheets

I took some liberties with the sheet names. You can change them to the
actual names or index numbers as applicable. I did not set up a test so if
you make this into a macro, be sure to test it on a copy before installing in
your original documents.

Dim x, y As Long
Dim myVar As Variant, fRng As String

With ActiveSheet
Set x = ActiveCell.Row
Set y = ActiveCell.Column
myVar = Cells(x, 1).Value
End With
With Worksheets("Database").Range("A2:A" & Cells(Rows.Count, 1).End(xlUP).Row)
Set c = .Find(myVar, LookIn:=xlValues)
If Not c Is Nothing Then
fRng = c.Address
.Cells(Range(fRng.Row, y).Copy Worksheets("Special Filters").Cells(x, y)
End If
End With

"ricowyder" wrote:

Dear users,

My workbook contains two worksheets. One is my "database", the other
one is a sheet in which I filter my database (special filter).

Each row in my database is a special case with several cells of
information.

My colleagues will be using the filter to find specific cases filtered
by different criterias. Therefore, the result will always be a
different amount of rows.

To their comfort, I would like to offer them the possibility to change
the cell value right in the filter.

Each "case", when it is created, has in column "A" a case-number. This
number might not be identical with the row number.

My idea is the following:

I would like to offer a sub, which can be started by a Shortcut (I can
handle that, I guess). The Sub should do then the following:

- ActiveWorksheet: ActiveCell find out Column XYZ, find out Case-
Number on the same row in Column A
- In other Worksheet: Find matching Case-Number, in the same row, go
to Column XYZ (as in ActiveWorksheet) and copy Copy Value of
ActiveCell into this cell

Thanks a lot for your help.

If you can also help me to restrict the short-cut to work only in a
specific area like Worksheets("Name").Range("A8:AA1000"), I would be
very thankful.

Thank you very much to anybody who contributes to this post.

Sincerely,

Rico


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default find matching cell in spread over two worksheets

On May 3, 11:21 pm, JLGWhiz wrote:
I took some liberties with the sheet names. You can change them to the
actual names or index numbers as applicable. I did not set up a test so if
you make this into a macro, be sure to test it on a copy before installing in
your original documents.

Dim x, y As Long
Dim myVar As Variant, fRng As String

With ActiveSheet
Set x = ActiveCell.Row
Set y = ActiveCell.Column
myVar = Cells(x, 1).Value
End With
With Worksheets("Database").Range("A2:A" & Cells(Rows.Count, 1).End(xlUP).Row)
Set c = .Find(myVar, LookIn:=xlValues)
If Not c Is Nothing Then
fRng = c.Address
.Cells(Range(fRng.Row, y).Copy Worksheets("Special Filters").Cells(x, y)
End If
End With



"ricowyder" wrote:
Dear users,


My workbook contains two worksheets. One is my "database", the other
one is a sheet in which I filter my database (special filter).


Each row in my database is a special case with several cells of
information.


My colleagues will be using the filter to find specific cases filtered
by different criterias. Therefore, the result will always be a
different amount of rows.


To their comfort, I would like to offer them the possibility to change
the cell value right in the filter.


Each "case", when it is created, has in column "A" a case-number. This
number might not be identical with the row number.


My idea is the following:


I would like to offer a sub, which can be started by a Shortcut (I can
handle that, I guess). The Sub should do then the following:


- ActiveWorksheet: ActiveCell find out Column XYZ, find out Case-
Number on the same row in Column A
- In other Worksheet: Find matching Case-Number, in the same row, go
to Column XYZ (as in ActiveWorksheet) and copy Copy Value of
ActiveCell into this cell


Thanks a lot for your help.


If you can also help me to restrict the short-cut to work only in a
specific area like Worksheets("Name").Range("A8:AA1000"), I would be
very thankful.


Thank you very much to anybody who contributes to this post.


Sincerely,


Rico- Hide quoted text -


- Show quoted text -


Thanks a lot! Unfortunately, it does give an error message at .Row or
at y or at .Column
-- message: "object required"
I tried different things, but was not successful. Can anybody assist?
I made some configurations. Here is my current code:

Sub CopyMe()

Dim x, y As Long
Dim myVar As Variant, fRng As String

With ActiveSheet
Set x = ActiveCell.Row
Set y = ActiveCell.Column
myVar = Cells(x, 1).Value
End With

ActiveSheet.Cells(x, y).Copy

With Worksheets("Dbase").Range("A2:A" & Cells(Rows.Count,
1).End(xlUp).Row)
Set c = .Find(myVar, LookIn:=xlValues)
If Not c Is Nothing Then
fRng = c.Address
Worksheets("Dbase").Range(fRng.Row, y).PasteSpecial
Paste:=xlValues
End If
End With

End Sub

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
matching 2 worksheets to find differences Vic Excel Discussion (Misc queries) 2 April 2nd 09 09:58 PM
Find and report matching numbers in two worksheets Colin Hayes Excel Discussion (Misc queries) 3 February 22nd 08 09:51 PM
Find Matching Records in Two Worksheets kittybat Excel Discussion (Misc queries) 2 April 5th 05 06:51 PM
Find matching records in two worksheets kittybat Excel Discussion (Misc queries) 3 March 30th 05 12:11 AM
Find Matching Data in different columns of different worksheets No Name Excel Programming 0 June 30th 04 10:02 PM


All times are GMT +1. The time now is 05:52 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"