test link images
Further based on your latest explanations, and looking at the uploaded file, it looks like
.a) stuff from the first worksheet SCHOOLS goes to the area Schools in Sample worksheet, / template workbook
.b) [url=https://i.postimg.cc/sDkNxQv8/stuff-from-XXXXX.jpg] stuff from the second worksheet XXXXX goes to the area Fund/Related Services in Sample worksheet, / template workbook
Further based on your latest explanations, and looking at the uploaded file, it looks like
.a) stuff from the first worksheet SCHOOLS goes to the area Schools in Sample worksheet, / template workbook
.b) stuff from the second worksheet XXXXX goes to the area Fund/Related Services in Sample worksheet, / template workbook
I think I can work on that to give you a start
Before I start: I expect Sheet 1 in your coding is a typo. It probably should be Sheet1. Never mind, I will use .Item(1) instead – that will get the first worksheet no matter what it’s named
This macro will take the version of your main file which I attach to this forum post, and it will produce from that your first workbook, named School 1.xlsx . It uses the Template file version I made and have also attached to this forum post, MyTemplateRaw.xlsx
Most of what I have done you may be able to work through and understand.
In words what it does, at least the new bits I doned for you, which you might not be familiar with:
I do a bit of simple loop while stuff after I find the value you want ( 1 in this example ). It starts when I find the 1, so I know then where the start row is, StRw , then I keep going in the loop while bit until I get the stop row, SpRw
Having got that , I am ready to do the copy paste bit. But I don’t actually use any copy paste method, since that is not very efficient for copying simple values. I use the .Value property thing. To Explain that:
You will see that in a 'comment I have written a pseudo code
' Pseudo code Range1.Value=Range2.Value
Used on the RHS the .Value returns/reads an array of the values in the range all in one go
Used on the LHS the .Value applies/writes the array of values offered on the RHS into the range all in one go.
For that to work properly the ranges will need to be the same size. So in the example in the macro I doned for you, I resized the cell on the LHS to what I know the range size is on the RHS




Reply With Quote
Bookmarks