Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro Debug Error
I have a "database" worksheet with 7 columns that input information on one
row at a time. I then have a second worksheet "request form" that I have my macro button on that extracts the information into a form type format from the last line of the "database" worksheet. I've been able to extract rows 1-4 but I get a debug error at the first 'ActiveSheet.Paste' when extracting info from row 5. I've cleared the formatting and deleted that specific row. What am I doing wrong? Sheets("data base of requests").Select Range("A1").Select Selection.End(xlDown).Select Selection.Copy Sheets("request form").Select Range("g10").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("b12").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("G12").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B8").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("G8").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B10").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B14").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B16").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B17").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B18").Select ActiveSheet.Paste End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro Debug Error
I think it must depend on what data you have in what cells.
It works fine for me but I probably haven't got my test data set up like yours What error do you get ? Have you stepped it through and watched where it fails and what the data looks like at that point ? Does this make your head ache when it runs ? ;-) Regards Trevor "Soroya1920" wrote in message ... I have a "database" worksheet with 7 columns that input information on one row at a time. I then have a second worksheet "request form" that I have my macro button on that extracts the information into a form type format from the last line of the "database" worksheet. I've been able to extract rows 1-4 but I get a debug error at the first 'ActiveSheet.Paste' when extracting info from row 5. I've cleared the formatting and deleted that specific row. What am I doing wrong? Sheets("data base of requests").Select Range("A1").Select Selection.End(xlDown).Select Selection.Copy Sheets("request form").Select Range("g10").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("b12").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("G12").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B8").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("G8").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B10").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B14").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B16").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B17").Select ActiveSheet.Paste Sheets("data base of requests").Select ActiveCell.Offset(-2, 1).Range("A1").Select Selection.End(xlDown).Select Application.CutCopyMode = False Selection.Copy Sheets("request form").Select Range("B18").Select ActiveSheet.Paste End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Debug Error in Code | Excel Discussion (Misc queries) | |||
Locking debug mode in a macro | Excel Worksheet Functions | |||
How do I resolve debug error macro Excel 2000? At least, any lead | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
help with debug | New Users to Excel |