Skip to Content
author's profile photo Former Member
Former Member

VBA code to search text and place values

Hi all,

I've a workbook with two spreadsheets in it. One called BEx, where I've a hierarchy and the other called Balance where I want to display a few values.

I'd like a code to do a search into the BEx side and when it find the text 'Assets' (all the texts are in column A), take its value from column B and place into cell B10 in the other spreadsheet.

Is is possible ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 09, 2006 at 02:30 PM

    Hi Pablo,

    Yes, it's possible.

    Here:

    /people/sap.user72/blog/2006/06/05/long-texts-in-sap-bw-displaying-in-bex-analyzer-introduction-to-excel-workbooks-formatting-part-i

    /people/sap.user72/blog/2006/06/05/long-texts-in-sap-bw-displaying-in-bex-analyzer-introduction-to-excel-workbooks-formatting-part-ii

    you may find the general principles of creating workbooks with VBA code.

    Though the blogs dedicated to workbooks formatting, you can apply (or go through trying to understand) some logic from there.

    Particularly:

    - how to determine the query result area, first/last columns/rows.

    - how to deal with several worksheets.

    Knowing this, all you have to do is to look for trimmed cell Value = 'Assets' in the 'A' column (a rows interval you'll know). Then place this value to particular cell of the 2nd sheet.

    Best regards,

    Eugene

    Message was edited by: Eugene Khusainov

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2006 at 06:32 PM

    Thank you Eugene, I'll try to understand what you explained in your weblogs.

    Cheers,

    Pablo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.