Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Combining two line of code

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combining two line of code

Try it this way...

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

Rick


"Ardy" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Combining two line of code

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


"Ardy" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Combining two line of code

On Jun 6, 10:28*am, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
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



"Ardy" wrote:
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- Hide quoted text -


- 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......
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Combining two line of code

Transpose just turns rows into columns and vice versa... As for getting
paid... Just your never ending gratitude...
--
HTH...

Jim Thomlinson


"Ardy" wrote:

On Jun 6, 10:28 am, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
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



"Ardy" wrote:
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- Hide quoted text -


- 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......

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to put series name next to individual line in line grap Otani Charts and Charting in Excel 3 February 23rd 10 07:24 PM
Combining a scatter with a line chart Miro[_2_] Charts and Charting in Excel 1 August 6th 08 08:42 PM
Help with combining/merging code Mekinnik Excel Programming 1 October 15th 07 10:07 AM
combining a stacked column and line chart together Abi Dodds Charts and Charting in Excel 1 February 20th 07 04:10 PM
Combining VBA code for columns [email protected] Excel Programming 8 September 28th 05 10:35 PM


All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"