search and do something

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Guest
I have created a macro that searches through a column of data and when it finds the desired text it inserts a cell moving the text to the right. All the text I wish to search for are refered to one after the other within the macro but is it possible to list all the text somewhere on the spread sheet and get the macro to refer to the list I hope this reads well.

Thanks :smile:
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi,
I am just wondering do you know how to create a macro to search more than one columns?
 
Upvote 0
Hi There I wrote this one to search in col G but is guess you could change the line ("G:G")to read ("G:H")but Ive not tried it.

Dim MyText

On Error GoTo handleerror

MyText = InputBox("Enter the 1st five characters of your Text")

Sheets("statusreport").Select
Do Until ActiveCell = " "

Columns("G:G").Select
Selection.Find(What:=MyBranch, After:=ActiveCell, MatchCase:=False).Activate
ActiveCell.Select
Selection.EntireRow.Cut
Sheets("Sheet1").Select
Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Select
ActiveCell.Offset(1, -1).Select
ActiveSheet.Paste
Range("a1").Select
Sheets("statusreport").Select
Loop
handleerror:
Range("A1").Select

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,350
Messages
6,171,590
Members
452,412
Latest member
sprichwort

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