Hello everybody,
What would be the best way to make code easier to read?
The following code just checks to see if a certain value is between two other values, but it's rather lengthy and difficult to read. If I were to read it a month from now I'd have a hard time trying to figure out what it does (which is where comments get in), but more importantly how it does this.
I'm inclined to try to make![]()
If (ActiveWorkbook.Sheets("Voertuigafhankelijke parameters").Cells(4, 2) > ActiveWorkbook.Sheets("Tarieven 2013").Cells(rijnummer, 5)) And ActiveWorkbook.Sheets("Voertuigafhankelijke parameters").Cells(4, 2) < ActiveWorkbook.Sheets("Tarieven 2013").Cells(rijnummer, 6) Then
Into something like 'Object A' etc![]()
ActiveWorkbook.Sheets("Voertuigafhankelijke parameters").Cells(4, 2)
So that you get:
Is that possible?![]()
If (Object A > Object B and Object A < Object C) Then
I'm not looking to optimize this specific piece of code, it runs fast enough.
The code that I've produced so far is just generally quite lengthy and difficult to read.
Thanks for your time.











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks