Hello, I am new to this forum, and am just starting to get involved heavily in Excel (business functions).
I am looking for VBA code to search a worksheet for a specific word, and then return corresponding values next to that text. I have attached a sample. I am new to VBA, and tried to google/search the coding, but to no avail. Please see the attached spreadsheet, I have added notes in it.
Thank you in advance.
Schwartz,
Welcome to the forum!
Attached is a modified version of your example workbook. In 'MTD Variance'!A3 is the following array formula. Array formulas need to be entered with Ctrl+Shift+Enter and not just Enter. It is then copied over and down to cell F12:
=IF(COUNTA(A$2:A2)>COUNTIF('Daily Input'!$A$3:$A$14,"Variance"),"",INDEX('Daily Input'!B$1:B$14,SMALL(IF('Daily Input'!$A$3:$A$14="Variance",ROW('Daily Input'!$A$3:$A$14),9^9),COUNTA(A$2:A2))))
If you require a VBA solution instead, let me know.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Thank you very much for your fast reply. That appears to be an easier solution than some VBA coding. It is funny, because I had originally tried a similar approach with Arrays, and failed. Thanks again!
But then, if at any time you want to use code, this might work.
Native Excel formulas are better though.
You could use a Pivot Table, no VBA.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Thank you for all the assistance! It is great to have knowledgeable people. I like the variety of responses, I will try them and see which one makes the most sense. Thanks again!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks