Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Copy Row

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johno - 30 May 2008 01:22 GMT
Hello all,
Firstly, this is a great forum for picking up great tips. I am new to
VBA programming and am having (to me) a small problem with my
spreadsheet.

I have my data set out in the format of Col A across to Col Y.
(database)? I am using a macro written by Ron De Bruin to select an ID
number that is always in Col A.

What I need to  be able to do is after selecting the required ID
number, select the entire data for the selected row so it can be
copied to  another location. I have tried the Selection.End(xltoright)
but all this does is select the very end data.

Would this forum be able to show me the command I need? or maybe a
combined macro that will find the ID number, select the complete data
and copy to another location?

Many thanks.

Les
Gary Keramidas - 30 May 2008 01:27 GMT
try this
range(selection,selection.end(xltoright)).select

or without selecting
range(selection,selection.end(xltoright)).copy

Signature

Gary

> Hello all,
> Firstly, this is a great forum for picking up great tips. I am new to
[quoted text clipped - 17 lines]
>
> Les
Norman Jones - 30 May 2008 01:35 GMT
Hi Johno,

To select the row data try:

       Selection.Resize(1, 8)

To copy this to (say) cell A10 on Sheet2, try:

       Selection.Resize(1, 8).Copy   _
               Destination:=Sheets("Sheet2").Range("A10")

If you are using Ron's code, you can be
certain that it is excellent. Post the code
you are using so that we can advise how y
our intent might be achieved.

---
Regards.
Norman

> Hello all,
> Firstly, this is a great forum for picking up great tips. I am new to
[quoted text clipped - 17 lines]
>
> Les
Norman Jones - 30 May 2008 01:40 GMT
Hi Johno,

I misread your data area; my response
should have read:

To select the row data try:

       Selection.Resize(1, 25)

To copy this to (say) cell A10 on Sheet2, try:

       Selection.Resize(1, 25).Copy   _
               Destination:=Sheets("Sheet2").Range("A10")

My comments vis-avis Ron's code, of course,
stand!

---
Regards.
Norman

"Norman Jones" <normanjones@wherforartthou.com> wrote in message news:...
> Hi Johno,
>
[quoted text clipped - 37 lines]
>>
>> Les
Johno - 30 May 2008 03:28 GMT
To both Gary K. and Norman J. many thanks for both suggestions, both
do exactely what I want. I will have a play around with both.

Cheers

Les
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.