Can anyone explain what the (3 * i) part of this code is doing?Please Login or Register to view this content.
Please
Can anyone explain what the (3 * i) part of this code is doing?Please Login or Register to view this content.
Please
Last edited by Sc0tt1e; 03-25-2014 at 06:31 PM.
It is multiplying value of i with 3.
It appears this code is storing reference to each third column from column 53
- Please remember to mark threads Solved with Thread Tools link at top of page.
- Please use code tags when posting code: [code]Place your code here[/code]
- Please read Forum Rules
What is the i part referring to?
it is probably a loop variable - you haven't posted enough code to be completely sure but it would be strange otherwise. ;-)
Last edited by JosephP; 03-26-2014 at 07:25 AM.
Josie
if at first you don't succeed try doing it the way your wife told you to
Actually, I'm more interested in the * aspect. From my experience with excel * is equal to multiple, I am curious to what it stands for in this instance.
I kind of guess that (e.g.) If i = 12 then it starts at 12 and then finds the 3rd cell/row from 12.
If it loops, I am guessing it keeps looking for the 3rd cell/row from the last result?
If I'm correct then cool, I'm starting to get it but I still don't get the * in the code
There is more code that defines "ApplymyFormat" but I left it out as it is not relevant. But here is total code for reference
Please Login or Register to view this content.
* = multiply
If i = 3, CellRef(3) will be set to S2LI.Cells(RowNumba, 53 + (3 *3)) which is column 62
When i = 4, CellRef(4) will be set to S2LI.Cells(RowNumba, 53 + (3 *4)) which is column 65
et cetera.
Aaaaaaaarrrrrrrrrrrrggggggggggghhhhhhhhhhhhhhhhhhhh!!!!!!!
What a duffus, I'm sitting here thinking why is it multiplying. I'm thinking the loop moves so it's multiplying off the offset, I didn't realise the start point remains static. In that case it makes a lot of sense, and makes me feel a little bit silly lol.
Cheers guys.
However I have tried this and it only pastes the first line, it doesn't work on lines 2+, can anyone see anything wrong with the code?
May you post workbook? If CellRef item is empty then code will not populate a row.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks