Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default different ways to copy a range?


Whats wrong with this syntax?
WsName is a string variable that is assigned the name of a worksheet
exists.
n and i are both integer variables that are based off of For
statements.

Worksheets(WsName).Range(Cells(5, n), Cells(2415, n)).Copy _
Destination:=Worksheets("Summary").Cells(4, i)

Thanks!


--
botha822
------------------------------------------------------------------------
botha822's Profile: http://www.excelforum.com/member.php...o&userid=36752
View this thread: http://www.excelforum.com/showthread...hreadid=569175

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default different ways to copy a range?


botha822 wrote:
Whats wrong with this syntax?
WsName is a string variable that is assigned the name of a worksheet
exists.
n and i are both integer variables that are based off of For
statements.

Worksheets(WsName).Range(Cells(5, n), Cells(2415, n)).Copy _
Destination:=Worksheets("Summary").Cells(4, i)


Where is your code bugging? Are you sure your variables are being
assigned? i think you should post all of your code

AR

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default different ways to copy a range?

Cells use not the cells of the activesheet

Use it like this

Worksheets(wsname).Range(Worksheets(wsname).Cells( 5, n), Worksheets(wsname).Cells(2415, n)).Copy _
Destination:=Worksheets("Summary").Cells(4, i)


--
Regards Ron de Bruin
http://www.rondebruin.nl



"botha822" wrote in message
...

Whats wrong with this syntax?
WsName is a string variable that is assigned the name of a worksheet
exists.
n and i are both integer variables that are based off of For
statements.

Worksheets(WsName).Range(Cells(5, n), Cells(2415, n)).Copy _
Destination:=Worksheets("Summary").Cells(4, i)

Thanks!


--
botha822
------------------------------------------------------------------------
botha822's Profile: http://www.excelforum.com/member.php...o&userid=36752
View this thread: http://www.excelforum.com/showthread...hreadid=569175



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default different ways to copy a range?


hey thanks for the advice guys. Both replies were useful in differen
ways. Any other online resources for learning VBA for Excel? I know
don't write very clean code and I would like to improve some more.

Thanks again

--
botha82
-----------------------------------------------------------------------
botha822's Profile: http://www.excelforum.com/member.php...fo&userid=3675
View this thread: http://www.excelforum.com/showthread.php?threadid=56917

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default different ways to copy a range?

David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

And he has links to lots of other sites.



botha822 wrote:

hey thanks for the advice guys. Both replies were useful in different
ways. Any other online resources for learning VBA for Excel? I know I
don't write very clean code and I would like to improve some more.

Thanks again.

--
botha822
------------------------------------------------------------------------
botha822's Profile: http://www.excelforum.com/member.php...o&userid=36752
View this thread: http://www.excelforum.com/showthread...hreadid=569175


--

Dave Peterson
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
The error of my ways. Cerberus Excel Discussion (Misc queries) 5 February 19th 08 09:36 PM
256 ways to make hamburger Nonni Excel Worksheet Functions 2 October 20th 06 11:50 PM
Alternative Ways to Spellcheck a Range Jay[_21_] Excel Programming 4 May 17th 06 09:43 PM
Ways of Summarising data BM Excel Discussion (Misc queries) 1 February 2nd 06 09:07 AM


All times are GMT +1. The time now is 05:15 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"