View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Bryan Hessey
 
Posts: n/a
Default Using Vlookup with merged cells...


-note, test this on a spare copy of your workbook!-

to test that, - on the required sheet, - rightmouse the tab, and select
View Code, - then copy

Code:
--------------------

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
' stop events
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Dim iRow As Integer, iLastRow As Integer
iRow = Target.Row
iLastRow = Range("A65536").End(xlUp).Row
ActiveSheet.AutoFilterMode = False
Range("A1:A" & iLastRow).Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=Range("a" & iRow).Value
End If
Application.EnableEvents = True
On Error GoTo 0
End Sub

--------------------

into there, and then change an item in column B

This assumes that you have headers on row 1, "Italy" etc in column A,
and "ComA" etc in column B

HTH

--

Bryan Hessey Wrote:
I think it would only be possible with VB code, with a Worksheet change
event on column B (or the pressing of a button) to trigger a Filter
parameter being set for column A to the value in column A of the row
concerned.

Does that sound like what you need. ie, that a change to an item in
column B (ComA) causes a filter to be set on the value in column A
(Italy)?

--



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=539128