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


I recorded the macro below.

I need a macro that will copy a group of cells. I select the firs
cell, say A11, and the macro takes over, selecting A11:N11 and copyin
the selection to A2 on Sheet3.
The problem with the macro is, it always selects A11:N11. I need it t
start where I choose, say, A17, then it selects A17:N17

Range("A11:N11").Select
Selection.Copy
Sheets("Macro").Select
Range("A2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Form").Select
End Sub

Thanks in advanc

--
Archi
-----------------------------------------------------------------------
Archie's Profile: http://www.excelforum.com/member.php...fo&userid=3084
View this thread: http://www.excelforum.com/showthread.php?threadid=50504

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default Range Select Macro

Range(ActiveCell, ActiveCell.Offset(0, 13)).Select

should do the trick

Greetings from New Zealand
Bill K
"Archie" wrote in
message ...

I recorded the macro below.

I need a macro that will copy a group of cells. I select the first
cell, say A11, and the macro takes over, selecting A11:N11 and copying
the selection to A2 on Sheet3.
The problem with the macro is, it always selects A11:N11. I need it to
start where I choose, say, A17, then it selects A17:N17

Range("A11:N11").Select
Selection.Copy
Sheets("Macro").Select
Range("A2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Form").Select
End Sub

Thanks in advance


--
Archie
------------------------------------------------------------------------
Archie's Profile:
http://www.excelforum.com/member.php...o&userid=30840
View this thread: http://www.excelforum.com/showthread...hreadid=505046



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Range Select Macro

if you have a cell in column A selected:


If selection.cells.count=1 and selection.cells(1).column=1 then
Selection.Resize(1,14).Copy Destination:=Sheets("Macro").Range("A2")
Application.CutCopyMode = False
Sheets("Form").Select 'don't need this if starting on Form
else
msgbox "To copy a row, select a single cell in column A"
end if

(untested)

Tim


--
Tim Williams
Palo Alto, CA


"Archie" wrote in
message ...

I recorded the macro below.

I need a macro that will copy a group of cells. I select the first
cell, say A11, and the macro takes over, selecting A11:N11 and copying
the selection to A2 on Sheet3.
The problem with the macro is, it always selects A11:N11. I need it to
start where I choose, say, A17, then it selects A17:N17

Range("A11:N11").Select
Selection.Copy
Sheets("Macro").Select
Range("A2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Form").Select
End Sub

Thanks in advance


--
Archie
------------------------------------------------------------------------
Archie's Profile:

http://www.excelforum.com/member.php...o&userid=30840
View this thread: http://www.excelforum.com/showthread...hreadid=505046



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Range Select Macro


Thank you, one and all.


--
Archie
------------------------------------------------------------------------
Archie's Profile: http://www.excelforum.com/member.php...o&userid=30840
View this thread: http://www.excelforum.com/showthread...hreadid=505046

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Range Select Macro

Here is a simple little sub to do what you asked. There is no error
checking. It assumes that the selected cell in the activesheet is the range
you want. If you are in column B instead of A, it would copy through column
O rather than column N. You should probably add at least the check if not
myrange is nothing then before proceeding ...

Sub myRangeSelect()
Dim myRange As Range
Set myRange = Selection
myRange.Resize(, 14).Copy Sheets("Macro").Range("a2")
Application.CutCopyMode = False
End Sub
--
Kevin Vaughn


"Archie" wrote:


I recorded the macro below.

I need a macro that will copy a group of cells. I select the first
cell, say A11, and the macro takes over, selecting A11:N11 and copying
the selection to A2 on Sheet3.
The problem with the macro is, it always selects A11:N11. I need it to
start where I choose, say, A17, then it selects A17:N17

Range("A11:N11").Select
Selection.Copy
Sheets("Macro").Select
Range("A2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Form").Select
End Sub

Thanks in advance


--
Archie
------------------------------------------------------------------------
Archie's Profile: http://www.excelforum.com/member.php...o&userid=30840
View this thread: http://www.excelforum.com/showthread...hreadid=505046




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
Select range in macro Chris Excel Discussion (Misc queries) 1 February 19th 10 01:33 PM
How do I select a range using a macro? brettopp Excel Discussion (Misc queries) 3 November 8th 06 11:40 PM
Using macro to select a range Rob Excel Worksheet Functions 3 November 6th 06 08:31 PM
select a range in a macro Andrew Excel Discussion (Misc queries) 3 May 10th 06 08:45 PM
When you select a range with a macro Patrick[_6_] Excel Programming 2 December 2nd 03 08:26 AM


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