HELP WITH FILTER OR VBA CODE

Jagat Pavasia

Active Member
Joined
Mar 9, 2015
Messages
359
Office Version
  1. 2021
Platform
  1. Windows
DEAR SIR,

I have 3 address in yellow highlighted,
my A1 have input name manually.

if I type "hitesh" in A1 then automatically find address contain heading of named "hitesh" and declare it to pink highlighted area.

if I type "ARVIND" in A1 then automatically find address contain heading of named "ARVIND" and declare it to pink highlighted area.

please help me.

I ATTACHED SCREEN SHOT BELOW..

THANK YOU
1.PNG
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Looking at the picture you posted, it looks like the address headings are located in merged cells. Start by unmerging all the merged cells. You should avoid merging cells because they almost always cause problems for macros. After you have unmerged the cells, copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in A1 and press the ENTER key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Address(0, 0) <> "A1" Then Exit Sub
    Application.ScreenUpdating = False
    Dim fnd As Range
    Set fnd = Range("A2", Range("A" & Rows.Count).End(xlUp)).Find(Target, LookIn:=xlValues, lookat:=xlWhole)
    If Not fnd Is Nothing Then
        Range("A" & fnd.Row + 1).Resize(9, 5).Copy Range("A2")
    End If
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Looking at the picture you posted, it looks like the address headings are located in merged cells. Start by unmerging all the merged cells. You should avoid merging cells because they almost always cause problems for macros. After you have unmerged the cells, copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in A1 and press the ENTER key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Address(0, 0) <> "A1" Then Exit Sub
    Application.ScreenUpdating = False
    Dim fnd As Range
    Set fnd = Range("A2", Range("A" & Rows.Count).End(xlUp)).Find(Target, LookIn:=xlValues, lookat:=xlWhole)
    If Not fnd Is Nothing Then
        Range("A" & fnd.Row + 1).Resize(9, 5).Copy Range("A2")
    End If
    Application.ScreenUpdating = True
End Sub
not working as i want
 
Upvote 0
It is hard to work with a picture. It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of your sheet. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). Also include a screenshot of your expected result.
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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