PC Review


Reply
Thread Tools Rate Thread

Active Cell Copy And Paste Sheet to Sheet

 
 
=?Utf-8?B?QS5SLkogQWxsYW4gSmVmZmVyeXM=?=
Guest
Posts: n/a
 
      2nd May 2006
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
 
Reply With Quote
 
 
 
 
mudraker
Guest
Posts: n/a
 
      2nd May 2006

Allen

Try

Option Explicit

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


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=537994

 
Reply With Quote
 
=?Utf-8?B?QS5SLkogQWxsYW4gSmVmZmVyeXM=?=
Guest
Posts: n/a
 
      2nd May 2006
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

"mudraker" wrote:

>
> Allen
>
> Try
>
> Option Explicit
>
> Sub CopyRows()
> If ActiveCell.Row > 60 Then Exit Sub
> Sheets("sheet1").Rows(ActiveCell.Row & ":60").Copy
> ActiveSheet.Paste
> End Sub
>
>
> --
> mudraker
> ------------------------------------------------------------------------
> mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
> View this thread: http://www.excelforum.com/showthread...hreadid=537994
>
>

 
Reply With Quote
 
mudraker
Guest
Posts: n/a
 
      3rd May 2006

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


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=537994

 
Reply With Quote
 
=?Utf-8?B?QS5SLkogQWxsYW4gSmVmZmVyeXM=?=
Guest
Posts: n/a
 
      4th May 2006
mudraker

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

Allan

"mudraker" wrote:

>
> 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
>
>
> --
> mudraker
> ------------------------------------------------------------------------
> mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
> View this thread: http://www.excelforum.com/showthread...hreadid=537994
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
transfer cell value from 1 sheet to another without copy/paste? sbmiller Microsoft Excel Worksheet Functions 3 20th Apr 2010 06:51 PM
Copy Paste from Class Sheet to Filtered List on Combined Sheet prkhan56@gmail.com Microsoft Excel Programming 6 16th Sep 2008 04:30 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Microsoft Excel Programming 3 23rd Jan 2006 09:57 PM
Re: To copy from a range in another sheet to the active cell William Benson Microsoft Excel Programming 0 8th Sep 2005 04:47 PM
How can i copy a value in a cell from a sheet and paste in anothe. =?Utf-8?B?Y2xhcHRvbg==?= Microsoft Excel Misc 5 24th Nov 2004 05:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.