Combining two line of code

  • Thread starter Thread starter Ardy
  • Start date Start date
A

Ardy

Hello All;
How would you combine this two line of code Excel-2007

Sheets(1).Range("B4").Copy
Sheets(3).Range("A3").PasteSpecial Paste:=xlPasteValues
Sheets(1).Range("B5").Copy
Sheets(3).Range("B3").PasteSpecial Paste:=xlPasteValues

I have tried

Sheets(1).Range("B4, B5").Copy
Sheets(3).Range("A3, B3").PasteSpecial Paste:=xlPasteValues
The first line is OK but the second gives me an error.

Ardy
 
Try it this way...

Sheets(1).Range("B4:B5").Copy
Sheets(3).Range("A3").PasteSpecial Paste:=xlPasteValues, Transpose:=True

Rick
 
Sheets(3).Range("A3").value = Sheets(1).Range("B4").value
Sheets(3).Range("B3").value = Sheets(1).Range("B5").value

or

Sheets(1).Range("B4, B5").Copy
Sheets(3).Range("A3").PasteSpecial Paste:=xlPasteValues, Transpose:=True
 
Sheets(3).Range("A3").value = Sheets(1).Range("B4").value
Sheets(3).Range("B3").value = Sheets(1).Range("B5").value

or

Sheets(1).Range("B4, B5").Copy
Sheets(3).Range("A3").PasteSpecial Paste:=xlPasteValues, Transpose:=True

--
HTH...

Jim Thomlinson









- Show quoted text -

That is great, I love this news group.......I hope some body pays you
guys becuse it is well worthed.....

Can you explain the Transpose part dose this mean go to right insted
of down......
 
Transpose just turns rows into columns and vice versa... As for getting
paid... Just your never ending gratitude...
 

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

Back
Top