This is the code, that i'm using, for every new search ,it creates a new sheet and the new sheet will be named after the searched word, but how do improve my code?Just a little info about this code that if the users adds asterisk before and after the word, it will do a wildcard search initially, passing everything to sheet2 but i have alter the codes to create a new search base on the searched word but also i am getting new errors. How should i check for error?
If the user leaves a blank in the textbox, the program will stop the macro instead of creating a empty sheet.
if the user adds asterisk in the search textbox, the program will
create a new sheet just for the wildcard searchstrSearch = Application.InputBox("Please enter the search string") Worksheets.Add().Name = strSearch Set rg = Sheets("Sheet1").Cells(1).CurrentRegion For a = 1 To rg.Rows.Count Set rgF = rg.Rows(a).Find(strSearch, , xlValues, xlWhole) If Not rgF Is Nothing Then rg.Rows(a).Copy Sheets(strSearch).Range("A60000").End(xlUp).Offset(1, 0) Set rgF = Nothing End If Next a Application.ScreenUpdating = True
*Blah*
, what should be the sheetname be? Also what errors are you getting? – Siddharth Rout Nov 22 '13 at 7:16