Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 13
Default Macro problem help please.

Hi all you brain boxes out there. Need some help please. I have a book with
about 10 different sheets in it. What I am after is a way to copy the
information from a worksheet row to another worksheet without going back and
forward cutting and pasting. The macro i was trying to use was this,
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+a
'
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("POrder").Select
ActiveCell.Offset(-4, 0).Rows("1:1").EntireRow.Select
ActiveSheet.Paste
Sheets("Photo Stock ").Select
ActiveCell.Offset(1, 4).Range("A1").Select
End Sub


Can some kind person tell me whatI am doing wrong besides banging my head
off the pc lol.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Macro problem help please.

Sub Macro3()
ActiveCell.EntireRow.Copy _
Sheets("POrder").Cells(Rows.Count, 1).End(xlUp)(2).EntireRow
End Sub

Will copy the entire row of the activecell to the bottom of sheet POrder....

HTH,
Bernie
MS Excel MVP


"Nevyn" wrote in message
...
Hi all you brain boxes out there. Need some help please. I have a book with
about 10 different sheets in it. What I am after is a way to copy the
information from a worksheet row to another worksheet without going back and
forward cutting and pasting. The macro i was trying to use was this,
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+a
'
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("POrder").Select
ActiveCell.Offset(-4, 0).Rows("1:1").EntireRow.Select
ActiveSheet.Paste
Sheets("Photo Stock ").Select
ActiveCell.Offset(1, 4).Range("A1").Select
End Sub


Can some kind person tell me whatI am doing wrong besides banging my head
off the pc lol.



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,942
Default Macro problem help please.

hi
you haven't given enough info to make a good assessment.
this line....
ActiveCell.Offset(-4, 0).Rows("1:1").EntireRow.Select
how did you determine the activecell on the other sheet??

the activecell exists only on the activesheet and if you don't want to be
flopping back and forth, then you will have to find another way to tell excel
where that cell is without selecting the sheet and cell.
here is a ditty that might show how it may work but the above line is the
the big question. this code just puts the copied data in the next row of the
other sheet which may not be what you want.

Sub copyit()
Dim r As Range
Dim ro As Range
Set r = ActiveCell
Set ro = Sheets("sheet3").Range("A65000").End(xlUp).Offset( 1, 0) 'change
r.EntireRow.Copy Destination:=ro
r.Offset(1, 4).Select ' this will change the activecell

End Sub

regards
FSt1

"Nevyn" wrote:

Hi all you brain boxes out there. Need some help please. I have a book with
about 10 different sheets in it. What I am after is a way to copy the
information from a worksheet row to another worksheet without going back and
forward cutting and pasting. The macro i was trying to use was this,
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+a
'
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("POrder").Select
ActiveCell.Offset(-4, 0).Rows("1:1").EntireRow.Select
ActiveSheet.Paste
Sheets("Photo Stock ").Select
ActiveCell.Offset(1, 4).Range("A1").Select
End Sub


Can some kind person tell me whatI am doing wrong besides banging my head
off the pc lol.

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,203
Default Macro problem help please.

Based on what you wrote in your other request for help about this (please,
just post questions in one place - makes everything easier for everyone
involved), and what you wrote here, I came up with this code:

Notice that I named it Macro3, so you can just copy this code, go into the
VB editor where you now have Macro3 and paste this code over all you
currently have, that'll allow it to work just like it does now, associated
with the click of a button I presume you've already got on the sheet?

Sub Macro3()
'copies the current row on a sheet to
'just below the last entry on a sheet
'named POrder
'Limitation: Only a single row may
'be selected when the macro is run,
'although you can have more than one
'cell in that row selected.
If Selection.Rows.Count 1 Then
'don't know what to do if multiple
'rows are selected, so do nothing
Stop
Exit Sub
End If
ActiveCell.EntireRow.Copy
Worksheets("POrder").Range("A" & Rows.Count). _
End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
'if you want to jump to A1 on the
'active sheet then
Range("A1").Select
End Sub

"Nevyn" wrote:

Hi all you brain boxes out there. Need some help please. I have a book with
about 10 different sheets in it. What I am after is a way to copy the
information from a worksheet row to another worksheet without going back and
forward cutting and pasting. The macro i was trying to use was this,
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+a
'
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("POrder").Select
ActiveCell.Offset(-4, 0).Rows("1:1").EntireRow.Select
ActiveSheet.Paste
Sheets("Photo Stock ").Select
ActiveCell.Offset(1, 4).Range("A1").Select
End Sub


Can some kind person tell me whatI am doing wrong besides banging my head
off the pc lol.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro problem [email protected] Excel Discussion (Misc queries) 6 January 2nd 07 09:22 PM
Macro problem tweacle Excel Worksheet Functions 0 February 15th 06 08:26 PM
macro problem tweacle Excel Worksheet Functions 0 December 27th 05 12:27 PM


All times are GMT +1. The time now is 10:31 AM.

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

About Us

"It's about Microsoft Excel"