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 / New Users / May 2006

Tip: Looking for answers? Try searching our database.

Active Cell Copy And Paste Sheet to Sheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
A.R.J Allan Jefferys - 02 May 2006 11:56 GMT
Hello There
Could Someone show me how i can create a macro to copy the activecell from,
I am only working with column 1,but up to row 60 . So if I select "a2" on
sheet 2 so the macro would need to look at sheet 1 "a2" and copy the contents
to sheet2 "a2" or whichever cell I select upto row 60

I hope this makes some sense to you

Many Thanks Allan
mudraker - 02 May 2006 13:32 GMT
Allen

Try

Option Explicit

Sub CopyRows()
If ActiveCell.Row > 60 Then Exit Sub
Sheets("sheet1").Rows(ActiveCell.Row & ":60").Copy
ActiveSheet.Paste
End Sub

Signature

mudraker

A.R.J Allan Jefferys - 02 May 2006 23:51 GMT
Hello Mudraker

and thanks for the reply.

This works well, but if possible i need it to run activecell by cell, See
this is a bookin sheet, so when a guest books in today and  he wants to book
another night in  a12. So i select a12 on sheet2  and the form selects a12 on
sheet 1 and copies only the contents of that cell or row. This form will have
31  sheets ,but will only ever look at the sheet before it.

Does this make sense
thanks  again Allan

> Allen
>
[quoted text clipped - 7 lines]
> ActiveSheet.Paste
> End Sub
mudraker - 03 May 2006 13:33 GMT
Allen

I hope I understand correctly what you are after

This macro uses the sheet.index function
I have assumed that you have your sheets in order from left (sheet1) to
right sheet31

Sub CopyRows()
If ActiveSheet.Index =1 Then Exit Sub
If ActiveCell.Row > 60 Then Exit Sub
Sheets(ActiveSheet.Index - 1).Rows(ActiveCell.Row).Copy
ActiveSheet.Paste
End Sub

If they are in the reverse order then use

Sub CopyRows()
If ActiveSheet.Index =1 Then Exit Sub
If ActiveCell.Row > 60 Then Exit Sub
Sheets(ActiveSheet.Index + 1).Rows(ActiveCell.Row).Copy
ActiveSheet.Paste
End Sub

Signature

mudraker

A.R.J Allan Jefferys - 04 May 2006 02:04 GMT
mudraker

You have hit it on the head, and i am greatful.
thankyou very much

Allan

> Allen
>
[quoted text clipped - 19 lines]
> ActiveSheet.Paste
> End Sub
 
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.