Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying areas and macro loops

run start time?......



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying areas and macro loops

Tried that code and run macro this is what it says in VBA...

Compile Error

sub or function not defined

and it has highlighted LastRow on the code line below in blue.

Lr = LastRow(Sheets("Sheet2")) + 1



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying areas and macro loops

woohoo....now we are getting there...thank you for your patience.

Only one slight problem......

the data values are being copied to sheet 2 like this.......
A B
1 F21
2 F22
3 F21
4 F22
5
6

To plot my graph how I want I need the data like this in sheet 2.
A B C
1 F21 F22
2 F21 F22
3 F21 F22
4 F21 F22
5
6

I have tried messing about with code to see if it would lay out
differently but keep getting errors.

By the way I must thank you again for your help....It is very much
appreciated.....



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default copying areas and macro loops

Sub CopyOneArea()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Lr = LastRow(Sheets("Sheet2")) + 1
Set sourceRange = Sheets("Sheet1").Range("F21:F22")
Set destrange = Sheets("Sheet2").Range("A" & Lr)
sourceRange.copy
destrange.Pastespecial Paste:=xlPasteAll, Transpose:=True
StartTimer
End Sub

--
Regards,
Tom Ogilvy


"dynamicsoul" wrote in message
...
woohoo....now we are getting there...thank you for your patience.

Only one slight problem......

the data values are being copied to sheet 2 like this.......
A B
1 F21
2 F22
3 F21
4 F22
5
6

To plot my graph how I want I need the data like this in sheet 2.
A B C
1 F21 F22
2 F21 F22
3 F21 F22
4 F21 F22
5
6

I have tried messing about with code to see if it would lay out
differently but keep getting errors.

By the way I must thank you again for your help....It is very much
appreciated.....



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Excel 2003: Macro to print areas in mulptiple worksheets Balcott Excel Discussion (Misc queries) 1 December 19th 07 08:34 PM
Copying print areas and Row and Chart Headings are displayed Barb Reinhardt Charts and Charting in Excel 2 January 24th 07 03:51 PM
Writing macro results to user defined areas within excel gauss1976 Excel Discussion (Misc queries) 1 July 27th 06 01:35 PM
Loops... Willabo Excel Discussion (Misc queries) 2 June 14th 06 04:08 PM
macro that loops to multiple columns Brad Zenner Excel Programming 1 July 22nd 03 03:17 AM


All times are GMT +1. The time now is 01:20 AM.

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

About Us

"It's about Microsoft Excel"