A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Active Cell Copy And Paste Sheet to Sheet



 
 
Thread Tools Display Modes
  #1  
Old May 2nd, 2006, 11:56 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Active Cell Copy And Paste Sheet to Sheet

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
  #2  
Old May 2nd, 2006, 01:32 PM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Active Cell Copy And Paste Sheet to Sheet


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

  #3  
Old May 2nd, 2006, 11:51 PM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Active Cell Copy And Paste Sheet to Sheet

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


  #4  
Old May 3rd, 2006, 01:33 PM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Active Cell Copy And Paste Sheet to Sheet


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

  #5  
Old May 4th, 2006, 02:04 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Active Cell Copy And Paste Sheet to Sheet

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


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Row Expansion Susan Worksheet Functions 11 February 28th, 2006 07:15 PM
Copy cell format to cell on another worksht and update automatical kevinm Worksheet Functions 21 May 19th, 2005 11:07 AM
Unable to Copy COUNTA() with cell references EugenioB Worksheet Functions 1 February 16th, 2005 01:07 PM
Can you copy and paste a cell in excel that has speech to another. salli General Discussion 1 October 9th, 2004 03:31 AM
Copy then Paste more than once Steved Worksheet Functions 14 August 18th, 2004 02:42 AM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.