Macro - Inserting text to a cell already containg text

  • Thread starter Dileep Chandran
  • Start date
D

Dileep Chandran

Hello everybody,

Is it possible to select a text from B100 of Book1.xls and paste it to
B100 (which already has a text) of Book2.xls?

Assume both books are open.
Assume B100 of Book1 contains "XYZ" and B100 of Book 2 contains "ABCD"
So the macro should run so as to change B100 of Book 2 "ABCD - XYZ"

Can anyone help?
Thanks and Regards
-Dileep
 
I

Ian

Range("B100").Select
Selection.Copy
Windows("Book2").Activate
Range("B100").Select
ActiveSheet.Paste
 
J

JMay

Isn't this code "replacing" the content of Book2 - cell B100 with XYZ,
not ABCD - XYZ.

How bout something more like: (Paste into a std module - Book2
Sub tester()
Windows("Book2").Activate
sTemp = Range("B10").Value
Windows("Book1").Activate
sNew = Range("B10").Value
Windows("Book2").Activate
sCombo = sTemp & " - " & sNew
Range("B10").Value = sCombo
End Sub

HTH
 
I

Ian

Correct. Sorry, I misread the OP.

--
Ian
--
JMay said:
Isn't this code "replacing" the content of Book2 - cell B100 with XYZ, not
ABCD - XYZ.

How bout something more like: (Paste into a std module - Book2
Sub tester()
Windows("Book2").Activate
sTemp = Range("B10").Value
Windows("Book1").Activate
sNew = Range("B10").Value
Windows("Book2").Activate
sCombo = sTemp & " - " & sNew
Range("B10").Value = sCombo
End Sub

HTH
 

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