I am trying to copy data from a log file to a summary file. I can open the workbooks successfully, but I can't identify them for the copy. Here is my code. Will someone please help?
Please Login or Register to view this content.
I am trying to copy data from a log file to a summary file. I can open the workbooks successfully, but I can't identify them for the copy. Here is my code. Will someone please help?
Please Login or Register to view this content.
Last edited by ka3pmw; 07-09-2021 at 05:44 PM. Reason: Incorrect Code
wkb is the workbook Log Summary.xlsm
ThisWorkbook is the workbook that contains the macro code.
Specifically what cells on what sheet are you copying and what is the destination?
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Source workbook is the Emergency Log ................... Destination Workbook is Log Summary
Source Sheet is Form ............................................. Destination sheet is Sheet 1
Cell D2 ................................................................... Cell D2
Cell I3 ................................................................... Cell D3
Cell J3 ................................................................... Cell F2
Cell I1 ................................................................... Cell F3
Cells B4:B152 ......................................................... Cells B4:B152
These should get copied every time an entry is made. I can send you a copy of the workbooks if you wish.
Last edited by ka3pmw; 07-10-2021 at 12:29 PM. Reason: Changed formatting and cells
Here are the workbooks. The password is ka3pmw
Here are the workbooks. The password is ka3pmw Emergency log
I have struggled with this and gotten it to this point:
Now I need to copy the cells. I have this but it crashes:Please Login or Register to view this content.
Does anyone have any ideas?Please Login or Register to view this content.
Try
Please Login or Register to view this content.
maniacb,
That returned a Runtime error 9 subscript out of range error.
Here is what I have. I start by using this to Set things up:
Then I use this to copy a cell:Please Login or Register to view this content.
and it does not work. The Workbooks("Source").Worksheets("Form").Range("D2").Copy _Please Login or Register to view this content.
Workbooks("Dest").Worksheets("Sheet1").Range("D2") should execute every tine an entry is made/changed on the Forms sheet. I think I have it in a good place but I'm not sure. Does anybody know why or have a better idea?
Last edited by ka3pmw; 07-11-2021 at 12:57 PM. Reason: Incorrect Code
I now have the startup problem solved but I am having trouble with the copy portion. Here is the code that I am using:
I am getting an error 9 and I can't figure out where. This is the section of code that gets executed with every entry.Please Login or Register to view this content.
The solution to the original problem was:
It is here that the variables are defined when the workbook is opened. Please look at this and advise.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks