Macro problem locating last line

R

Ryk

(Sorry to cross post, didn't see the macro group until now)
I am using the following macro (it is one of three that are all the
same but point to different Month Sheets) to do two jobs at once, and
the second part is acting oddly when copying from the Suggestions sheet

and moving it into the Suggested Changes sheet. The first part copies
to its month sheet just fine, but I want the suggestions copied too one

sheet and to be one after the other. A1-A20 have values in my test
run, so the effect if I run this twice, is I should see the same 20
lines of data one after the other, but I do not, the first run puts the

data perfectly at the top starting at A1, but running it a second time
places the next data starting in A996 not A21 as I think it should.
Now if it is because I grab A1-Z1000 to copy, can I set it in the macro

to only copy the used rows on suggestions sheet and correct this?

Any ideas please?


Sub copy2()
'
' copy1 Macro
' Macro recorded 8/22/2006 by ryk
'
' Keyboard Shortcut: Ctrl+t
'
Range("A4:AX1006").Select
Selection.Copy
Sheets("Month Two").Select
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Month Two").Select
Range("A1").Select
Selection.Copy
Sheets("Month Two").Select
Range("A1").Select
ActiveSheet.Paste
Range("B6:B1006").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Sheets("Suggestions").Select
Range("A5:Z1000").Select
Selection.Copy
Sheets("Suggested Changes").Select
Range("A1").Select
mycell = Cells(Rows.Count, "A").End(xlUp).Row
Range("A" & mycell).Select
Selection.PasteSpecial Paste:=xlPasteFormats,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A" & mycell).Select


End Sub


Thanks for any help given...


Ryk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top