Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. I'm new to VBA and I've been trying to get a macro that will copy
the row of a selected cell in one sheet (called Recipe Book), and copy it into another sheet (called Missing Website) on the next blank row. I found some coding someone posted online and I've been testing it but it keeps crashing. The following is the code I found. I put an arrow (<--) on the line where the code crashes. I can't figure out why the Range("A65536").Select part doesn't work. Any help would be appreciated. Thanks. Sub PasteRow() Application.ScreenUpdating = False Worksheets("Recipe Book").Select ActiveCell.EntireRow.Select Selection.Copy Worksheets("Missing Website").Select Range("A65536").Select <-- ActiveSheet.Paste Application.CutCopyMode = False Sheets("Recipe Book").Select ActiveCell.Select Application.ScreenUpdating = True End Sub Note: on the "Range("A65536").Select" line the original code is "Range("A65536").End(xlUp).Offset(1, 0).Select" but I omitted the code after "Range("A65536" because it's the "Range("A65536").Select" part that's not working. *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
give this a try...
Sub PasteRow() ActiveCell.EntireRow.Copy Destination:= _ Worksheets("Missing Website").Cells(rows.count, "A").end(xlup).offset(1,0) End Sub -- HTH... Jim Thomlinson "Adam Chan" wrote: Hello. I'm new to VBA and I've been trying to get a macro that will copy the row of a selected cell in one sheet (called Recipe Book), and copy it into another sheet (called Missing Website) on the next blank row. I found some coding someone posted online and I've been testing it but it keeps crashing. The following is the code I found. I put an arrow (<--) on the line where the code crashes. I can't figure out why the Range("A65536").Select part doesn't work. Any help would be appreciated. Thanks. Sub PasteRow() Application.ScreenUpdating = False Worksheets("Recipe Book").Select ActiveCell.EntireRow.Select Selection.Copy Worksheets("Missing Website").Select Range("A65536").Select <-- ActiveSheet.Paste Application.CutCopyMode = False Sheets("Recipe Book").Select ActiveCell.Select Application.ScreenUpdating = True End Sub Note: on the "Range("A65536").Select" line the original code is "Range("A65536").End(xlUp).Offset(1, 0).Select" but I omitted the code after "Range("A65536" because it's the "Range("A65536").Select" part that's not working. *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a bunch, this code works perfectly ^.^
Adam *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Adam -
I'm not sure why the code above is 'crashing' at all, let alone where you say it does ... works fine for me. Are you sure it's EXACTLY as you have it entered here? That is, no extra characters or anything? Note that the code (as written) copies into the last row of the Missing Website sheet -- the code you deleted is what finds the next empty row ... //ray |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi. I tested your copy code and it works fine. Check your scroll
range in VBA under sheet proprties. Maybe it's set to less than A65536... Here's the code that works fine for me... Sub PasteRow() Application.ScreenUpdating = False Worksheets("Recipe Book").Select ActiveCell.EntireRow.Select Selection.Copy Worksheets("Missing Website").Select Range("A65536").End(xlUp).Offset(1, 0).Select ActiveSheet.Paste Application.CutCopyMode = False Sheets("Recipe Book").Select ActiveCell.Select Application.ScreenUpdating = True End Sub On Aug 7, 2:24 pm, Adam Chan wrote: Hello. I'm new to VBA and I've been trying to get a macro that will copy the row of a selected cell in one sheet (called Recipe Book), and copy it into another sheet (called Missing Website) on the next blank row. I found some coding someone posted online and I've been testing it but it keeps crashing. The following is the code I found. I put an arrow (<--) on the line where the code crashes. I can't figure out why the Range("A65536").Select part doesn't work. Any help would be appreciated. Thanks. Sub PasteRow() Application.ScreenUpdating = False Worksheets("Recipe Book").Select ActiveCell.EntireRow.Select Selection.Copy Worksheets("Missing Website").Select Range("A65536").Select <-- ActiveSheet.Paste Application.CutCopyMode = False Sheets("Recipe Book").Select ActiveCell.Select Application.ScreenUpdating = True End Sub Note: on the "Range("A65536").Select" line the original code is "Range("A65536").End(xlUp).Offset(1, 0).Select" but I omitted the code after "Range("A65536" because it's the "Range("A65536").Select" part that's not working. *** Sent via Developersdexhttp://www.developersdex.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range.Select error and screen maximizing error in Workbook_Open() | Excel Programming | |||
Range.Select error and screen maximizing error in Workbook_Open() | Excel Programming | |||
Can't select range. Why the error? | Excel Programming | |||
Help with this error Unknown reason for error with Range().Select | Excel Programming | |||
Range Select Error | Excel Programming |