Flux rss
Search : in
By : Relevance Date Username
Statut : Not resolved

Macro help - search for text in Excel

TheBeam, on Monday 18 August 2008 à 13:43:46
Hello,

I've been trying to wrap my head around how to do this but haven't had any luck -- I want to search for text in excel in a spreadsheet of 4000 entries...so it'll save a ton of time.

Here's the situation I want solved.

I have an array of 22 columns (AI:BD) that is mostly blank (formulas returning text of "") and occasionally 1-2 (identical) text inputs per row. What I want to do is search this pretty much blank array for the account code (a number) and put it in one column (AH) on the same row. How do I do this?
Configuration: Windows XP
Internet Explorer 6.0
Reply to TheBeam  Report this message to moderators Go to last message

1


  • This message seems useful, vote!
  • Report this message to moderators
 downwiththeho, on Friday 31 October 2008 à 15:53:20
This is a Rube Goldberg way to do this, but I've found it to be pretty effective.

Copy the entire spreadsheet and paste into a basic text editor like notepad.

Then copy the text from notepad into MS Word.

The first step is to replace all paragraph breaks with a non-numeric character but also one unlikely to appear in your data. I find that '|' is usually safe. Launch the search and replace box, enter ^p as the search string, and enter | as the replacement. Make sure you enable highlight formatting. Hit replace all. MS Word will convert all line breaks into the highlighted pipe character.

Next, you need to isolate the numbers. Open the search and replace tool. With the wildcards option enabled, enter the following as your search string: [0-9] . Set the replace option to be the 'find what text option' which is expressed as ^& . Enable formatting, and choose to make it highlighted. Then hit replace all. You will then see anything with a number now treated with a visual highlight.

Now it's time to get rid of the data you don't care about. From search and replace, you want to remove any character that is not highlighted. Choose '?' as your search string, choose 'not highlighted' from your format option, and enable wildcards. For replace, leave it blank. Hit replace all. You will then be left with only your numbers and pipes, all highlighted.

The last step is to reconvert the pipes into carriage returns. Search for '|' and replace with '^p'. You will then be left with your accounts, a carriage return reflecting each seperate record.

Copy the above, paste into notepad, then paste into a column in MS excel. Voila.

This method isn't great if your data includes numeric characters that you don't want. (numbers that aren't part of the account string)

You can write a VB function that does the above or use the macro recorder if you need to run this multiple times.

Again, definitely not elegant but works. I've found the wildcard tool in MS to be very robust, provided you are willing to get creative.
Reply to downwiththeho

Résultats pour Macro help search for text in Excel

Macro in Excel to read email from gmail Hello, I need a macro in excel which will allow me to login to my gmail account and scan thru unread emails received from ("JG") having ("Urgent Message") in the subject line and save the body of the mail into excel worksheet and save the attached PDF... en.kioskea.net/forum/affich-33066-macro-in-excel-to-read-email-from-gmail
Excel Macro Help Hello, I am trying to create a macro within Excel 2003, which will extract data from a Text document into an Excel spreadsheet and sort the data as required. This is made slightly more difficult by the inconsistency in the data which is explained... en.kioskea.net/forum/affich-30377-excel-macro-help
Macro to down load text files from intranet Hello, Please help me in finding a macro in excel which will download files from Intranet. Certain txt files are saved in URL format in our company intranet. We need to download them one by one for further processing. What I want is if I will copy... en.kioskea.net/forum/affich-29666-macro-to-down-load-text-files-from-intranet

Résultats pour Macro help search for text in Excel

Excel tips : How to insert date In an Excel cellExcel tips : How to insert date In an Excel cell Below are some tips on how to insert date and time in an excel cell for a specific purpose:- To insert current date, press “CTRL”+ “;” in the chosen cell. To insert current... en.kioskea.net/faq/sujet-313-excel-tips-how-to-insert-date-in-an-excel-cell
How to remove Hyperlink on copied text from website?How to remove Hyperlink on copied text from website? When copying information on website, obviously the hyperlink from the text will also appear on the edited text. To remove the hyperlink from the text, you need to right on the designated... en.kioskea.net/faq/sujet-320-how-to-remove-hyperlink-on-copied-text-from-website
Keyboard Shortcuts for WindowsKeyboard Shortcuts for Windows Windows System In a General Folder and text programs In a General Folder For a Selected Item a Folder For Microsoft Word For Microsoft Excel For Microsoft PowerPoint For Internet Explorer There are a... en.kioskea.net/faq/sujet-213-keyboard-shortcuts-for-windows

Résultats pour Macro help search for text in Excel

Excel active cell macroHello, I'm trying to write a macro in excel which would copy and paste a range from WITHIN THE SAME ROW in the same sheet as the active cell is selected. For example let's say i select a cell within range A6:P36 then i would like the macro... en.kioskea.net/forum/affich-25813-excel-active-cell-macro
Excel: Macro HelpHello, I ned some help setting up a macro for Excel. I have a lost of IDs/SKUs on Sheet 1, and a partial list on Sheet2. What I would like to do is cross-check the two sheets and delete all the rows on Sheet1 that's already listed on sheet2. The... en.kioskea.net/forum/affich-5884-excel-macro-help
Excel Macros help neededHello, Can someone help me, I am trying to create a macro in excel that allows me to create a copy of a worksheet, clear its contents then hyperlink it to a particular cell. The problem is that I want it to link a different page to a different cell... en.kioskea.net/forum/affich-17504-excel-macros-help-needed

Résultats pour Macro help search for text in Excel

Processes - calc - calc.exe The process calc.exe corresponds to Windows' Calculator application. The file that corresponds to this process is normally found in the directory "%SystemRoot%\system32\calc.exe" (where %systemroot% is usually C:\WINDOWS.) It is an application which... en.kioskea.net/processus/calc-exe.php3