View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
JLatham JLatham is offline
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.