• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Log data Changes in Table


New Member
Hi vletm

Worked some more things out today. Have attached a WB. There are some questions on the worksheet.

Can you do a macro button or 2. To say move a train forward, release a freight, move another train forward and then use pull to position in If some items released do they not move ?

Macro to : move train backward to an different Location #.

Also your quote:
"Each Location has four Rails which can use (with some rules). eg 'Move' can do only to empty Rail." Also a macro to do this. Do I select Rail and then Move ?

I can then open the spreadsheet and the vba and F8 step thru the codes and see what changes etc are happening as they occur.

Sorry to be a bit slow but this will do a lot more than I thought of doing myself.
Thanks Charles



Excel Ninja
> 7007, 8090
I didn't found those Freights - those need to RENAME from 'free Freights' (and after that there should be ready ALL used Freights as well as Trains).
Next, You have to figure - how to get You needed configuration = which freights have to move that way You wanted ... only Trains can move those.

> There are already Your named 'buttons' - eg click Train GAWA-E > then You can see those!
All moves have to do one-by-one movement - test those Yourself.

> As written - these trains move with freight only forward -- hmm?
Have You noticed, if You keep same Location (different Rail) then the result is different than if Location is different?
( = location to other location - train's direction always changes )

> Always (the most of) have to do both selections - 1st Location and after that Rail as tried explain above - - - test test test.

> There will be need to add / change some rules, but You should test - what is missing? what would work other way?


New Member
Hi vletmood
Have checked out new spreadsheet, looks good, the only thing is PULL, I have not got to work yet. What is the steps to use. Once a selection is made the PULL does not appear on the selection row for direction backward forward etc.

Have attached a spreadsheet that I had one just before I received your latest WB. as well.

Have change around a little bit with some ideas. It may have upset your codes. Just some ideas only. See what you think.



New Member
With the program there will 3 dif4547ferent sets of trains, one set of which is only used each day.
Say Day1 Trains #1234 , and trains #4546 and train #2345
on Day 2 Trains # 467 9081 and # 2346
Day 3 Trains # 4568 1235

Not need to be sorted yet but when WB opened the trains you want for that day will have to be selected. eg day1 or day 2 or day3 etc

After the day is completed the logregister will be cleared of data only ready for the next day.


Excel Ninja

I have tried to explain that Do not change layout ... that way!
There are tight rules with positions of 'Location & Rail's.
I 'think' >> You have to continue with my the latest version.
I have use trains sometimes. At station (location) aren't there normally some rails (here - always four).
Some rails are 'waiting for next train with freights) - some has already train with or without freight.
You ... added extra rails -- as with anything else too - what is enough?
Just now, 'the trail company' has has money to build just those rails and locations.

Normally Trains 'works' the best then those are in the end of 'Location'.
'PULL' makes possible to 'move' with one click to the end of 'Location' - depends of direction.
'Train' have to be at least one step from 'in the end of Location'.

Set of trains:
a) First, You could collect Your needed Train & Freight combinations
eg Day 1 to Location 1 ... one train with freight per rail
as well as other days to other Locations as above

b) ...hmm?
Do You mean that other 'shift' would move/take care train between days ...hmm?
That would be possible in the real world ... but ...
Could You move 'daily trains' to park somewhere? Even real trains do not fly anywhere... or so?

c) clear log
Clearing would be possible to do after confirm - eg in the morning.
... or should it save for few days - if You would like to see later - what has done?
((( above works with this file )))
As well as ... it would be possible to 'replay' previous days actions.
So far, I do not do this!