ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   macro selecting row that cursor is on (not the same cell every tim (https://www.excelbanter.com/excel-discussion-misc-queries/188020-macro-selecting-row-cursor-not-same-cell-every-tim.html)

Jeremy

macro selecting row that cursor is on (not the same cell every tim
 
I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.

Gary''s Student

macro selecting row that cursor is on (not the same cell every tim
 
Any specific destination on the different tab??
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.


Jim Cone[_2_]

macro selecting row that cursor is on (not the same cell every tim
 

Substitute "ActiveCell" for the cell reference used in the recorded macro...
ActiveCell.EntireRow.Copy
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Jeremy" <jeremiah.a.reynolds @ gmail.com
wrote in message
I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.

Jeremy

macro selecting row that cursor is on (not the same cell every
 
Yes, It will alsays paste into B1 (paste special as value with transpose
checked)

"Gary''s Student" wrote:

Any specific destination on the different tab??
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.


Gary''s Student

macro selecting row that cursor is on (not the same cell every
 
Sub missive()
Set s2 = Sheets("Sheet2")
ActiveCell.EntireRow.Copy
s2.Range("B1").PasteSpecial Transpose:=True
End Sub

For test purposes, I used "Sheet2" as the name of the destination sheet.
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

Yes, It will alsays paste into B1 (paste special as value with transpose
checked)

"Gary''s Student" wrote:

Any specific destination on the different tab??
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.


Jeremy

macro selecting row that cursor is on (not the same cell every
 
What If I only need the data through Column V not the entire row?

"Gary''s Student" wrote:

Sub missive()
Set s2 = Sheets("Sheet2")
ActiveCell.EntireRow.Copy
s2.Range("B1").PasteSpecial Transpose:=True
End Sub

For test purposes, I used "Sheet2" as the name of the destination sheet.
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

Yes, It will alsays paste into B1 (paste special as value with transpose
checked)

"Gary''s Student" wrote:

Any specific destination on the different tab??
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.


Gary''s Student

macro selecting row that cursor is on (not the same cell every
 
A small change in the copy line:

Sub missive()
Set s2 = Sheets("Sheet2")
rw = ActiveCell.Row
Range("A" & rw & ":V" & rw).Copy
s2.Range("B1").PasteSpecial Transpose:=True
End Sub
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

What If I only need the data through Column V not the entire row?

"Gary''s Student" wrote:

Sub missive()
Set s2 = Sheets("Sheet2")
ActiveCell.EntireRow.Copy
s2.Range("B1").PasteSpecial Transpose:=True
End Sub

For test purposes, I used "Sheet2" as the name of the destination sheet.
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

Yes, It will alsays paste into B1 (paste special as value with transpose
checked)

"Gary''s Student" wrote:

Any specific destination on the different tab??
--
Gary''s Student - gsnu200787


"Jeremy" wrote:

I need to create a macro to copy an entire row and paste as a transposed list
on a different tab. when recording the macro how can I make sure that in
future uses it will use the curson reference as a selection point, not the
absolute reference.

to clarify:
I want the user to be able to select A20 and have all the items in row 20
copied over. The next user may need row 32, so they will select A32 and use
the macro.

I know how the process to record, and it's a very easy macro, I just don't
want the macro to keep selecting the same row.


Jeremy

macro selecting row that cursor is on (not the same cell every
 
That worked perfectly. One last question for this. I am usiny the code you
provided. How can I make it end on the Sheet2 page? Righht now it leaves
ends on Sheet1.

Gary''s Student

macro selecting row that cursor is on (not the same cell every
 
One additional line:

Sub missive()
Set s2 = Sheets("Sheet2")
rw = ActiveCell.Row
Range("A" & rw & ":V" & rw).Copy
s2.Range("B1").PasteSpecial Transpose:=True
s2.Activate
End Sub


--
Gary''s Student - gsnu200787


"Jeremy" wrote:

That worked perfectly. One last question for this. I am usiny the code you
provided. How can I make it end on the Sheet2 page? Righht now it leaves
ends on Sheet1.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com