working with macros: keyword search into a new sheet from my basesheet with 1000 entries.

Aishwerya

New Member
Joined
Jan 9, 2017
Messages
1
hi..i am very new to excel and with macros as well..but i want to know if I am having a spreadsheet with around more than 1000 products in a single column and a corresponding column with another value and i want to create a list of 10 products from the base sheet into a new worksheet by only typing the keywords in the new sheet. Then how can that be done ?
It should pull the product name as well as the corresponding value present in the base sheet and should work with every new sheet opened.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You need to use a specific range to type in your entries and it should be the same range on each new sheet. I am not quite sure what this means
should work with every new sheet opened.
, bit if you want to copy from a source workbook to sheets in a new work book, then in the new workbook the code below installed in the ThisWorkbook code module should work. Assume your base workbook name is "Source.xlsx) and is in the same directory as the destination workbook and both workbooks are open. Assume the entry range is Column A of the destination sheet and the source range is Columns A and B of the source sheet.
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Dim sh1 As Worksheet, fn As Range
Set sh1 = Workbooks("Source.xlsx").Sheets("Sheet1") 'This would be the sheet holding the source list.  Use actual workbook and sheet name.
If Not Intersect(Target, sh.Range("A:A")) Is Nothing Then
 set fn = sh1.Range("A:A").Find(Target.Value, , xlValues, xlWhole)
  If Not fn Is Nothing Then
   fn.Resize(1, 2).Copy Target
  End If
End If
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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