MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro help


Posted by Cathy on October 19, 2001 12:04 PM

Need help with creating a macro.

I have information in one cell I would like combine with another cell, separated with a hyphen.

ie.

Cell A2
12

Cell A3
14569

End results:
12-14569 (either in a new cell or in cell A2)

Thanks!


Posted by Juan Pablo on October 19, 2001 12:06 PM

You can easily do this with a formula. Just put
=A2&"-"&A3

Juan Pablo

Posted by Mark W. on October 19, 2001 12:07 PM

Why not use a formula...instead of a macro?

=A2&"-"&A3

Posted by Mark W. on October 19, 2001 12:09 PM

As the day wears on... I'm getting slow (nt) : )

Posted by Cathy on October 19, 2001 12:16 PM

Dobleclick on the Sheets or in the Workbook (In the Visual Basic editor, the macro should be in one of those)

Juan Pablo

Posted by Cathy on October 19, 2001 12:50 PM

Got it to work on one spreadsheet but for some reason not another

There is an existing spreadsheet which won't calculate the formula, but if I open a new spreadsheet, everything is fine. Help??


Posted by Mark W. on October 19, 2001 12:57 PM

Re: Got it to work on one spreadsheet but for some reason not another

What's the format of the cell where you're entering
the formula? There is an existing spreadsheet which won't calculate the formula, but if I open a new spreadsheet, everything is fine. Help??