cancel
Showing results for 
Search instead for 
Did you mean: 

VBA code to search text and place values

Former Member
0 Kudos

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 ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Cheers,

Pablo

Former Member
0 Kudos

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