macro on different reports CTRL+F in formula

  • Thread starter Ndrocchietto |Sono un cattomassocomunista liberale
  • Start date
N

Ndrocchietto |Sono un cattomassocomunista liberale

it looks really easy but I am thinking since more than 24 hours.
I need to merge two values of two different cells with a space, it
looks easy
=B23&" "&B24 but in reality every report is different and I am trying
to register a macro.
so if I write B23, B24 as in the example the next sheet could have
the the two values everywhere. So registering the marco use CTRL F to
find the value I need then register then i press CTRL arrow right to
read the value on the cell on the right, it works as a charm with one
value because the macro find the string i need and then goes to the
right to take the value I need but now I have to merge as in the
example above( =B23&" "&B24) or worse (sheet1!B23& etc) if refers to
another sheet. I am trying to find a formula to combine offset search
find index, I tried to built a VBA function, but does not work
when I have a formula excel recognize a specific cell not the one to
the right of the string I look with ctrl f
 
B

Ben McClave

Hello,

Once your macro identifies the first cell (as you say that it can), this line will merge the contents of that cell with the cell one column to the right of it:

MsgBox ActiveCell.Value & " " & ActiveCell.Offset(0, 1).Value

Just change the "MsgBox" part to whatever you need (i.e. a Range value, a variable, etc.)

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top