Range Select Macro

A

Archie

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
 
B

Bill Kuunders

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

should do the trick

Greetings from New Zealand
Bill K
 
T

Tim Williams

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top