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

I want to copy a range on a ws from A2 to H.. where the
text entry in colum H ends. Please help.

Regards
JA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to copy a range

Hi jamesa,

Try this

Sub CopyMyRange()

Dim r As Integer
r = 2
Do While Cells(r, 7) < ""
r = r + 1
Loop
Range(Cells(2, 1), Cells(r - 1, 7)).Copy

End Sub



------------------------------------------------
~~ 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: 27,285
Default Macro to copy a range

Here is one possible interpretation of what you are asking:

Dim rng as Range
set rng = cells(rows.count,"H").end(xlup)
Range(Range("A2"),rng).copy destination:=Range("M2")

--
Regards.
Tom Ogilvy
jamesa wrote in message
...
I want to copy a range on a ws from A2 to H.. where the
text entry in colum H ends. Please help.

Regards
JA



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 copy from range puiuluipui Excel Discussion (Misc queries) 3 October 19th 09 05:03 PM
macro to copy only range with data ramzi Excel Discussion (Misc queries) 2 January 29th 09 11:28 AM
macro to copy range Frank Situmorang[_2_] Excel Worksheet Functions 7 June 3rd 08 09:54 AM
Need help - Macro to copy a specific range Dileep Chandran Excel Worksheet Functions 0 December 4th 06 10:24 AM
MACRO TO COPY TO A RANGE asuncionw Excel Discussion (Misc queries) 3 February 9th 06 04:39 PM


All times are GMT +1. The time now is 01:58 PM.

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"