I have a new spreadsheet (Book1) in which I populate cells via a query from a SQL data base. Data is placed at cell A1. It works.
I have a macro (ctl-F) that massages the data, add a few columns, does some totaling. Works.
I have another macro (ctl-H) that inserts four blank lines at the top of the spreadsheet (Book1), opens another spreadsheet (header.xls), gets the first three rows (header information for my newly created spreadsheet) and copies the data to the clipboard, goes back to the original spreadsheet (Book1), goes to cell A1 and pastes. This does not work. However, if I step through the macro, it does work.
Why does the macro work if I step through it, but not if I execute the macro with my ctl-key sequence?
If I can get the header macro to work, I want to call it from my ctl-F macro to eliminate the end user from having to execute two macros.
I have a macro (ctl-F) that massages the data, add a few columns, does some totaling. Works.
I have another macro (ctl-H) that inserts four blank lines at the top of the spreadsheet (Book1), opens another spreadsheet (header.xls), gets the first three rows (header information for my newly created spreadsheet) and copies the data to the clipboard, goes back to the original spreadsheet (Book1), goes to cell A1 and pastes. This does not work. However, if I step through the macro, it does work.
Why does the macro work if I step through it, but not if I execute the macro with my ctl-key sequence?
If I can get the header macro to work, I want to call it from my ctl-F macro to eliminate the end user from having to execute two macros.