dukeofscouts
Board Regular
- Joined
- Jan 19, 2009
- Messages
- 146
Well the good news is that I got the macro written correctly. Bad news is that it is too long. So here goes my question: How can I get this shorter?
Background is that I'm working on an excel workbook to solve Soduko puzzels. I wanted to push my excel skills and see how I could use excel to mimic some tools other programs use to help beginners solve puzzels. So far things are going well.
-I have the Several 27*27 puzzel ranges set up,
--First starts in B2 and is a merged and copied down to a 9*9 grid. This is used to maintain the original puzzel so I can go back and start over,
--the second starts in AD2, this also is a 9*9 merge and copy that simply copies the the range from B2, I then can overwrite the formulas with my values here.
--The third in BF2 is a 27*27, this range creates the "pencil marks" showing what a each cell could be in the range AD2 based on the values in AD2.
--Finally (well not really but the others wont have any effect on this) there is CH2 a 27*27 that checks to see based off of the values in BF2 to see if there are any cells in AD2 that are not filled yet, but that there is a set value for it to be.
I've changed all TRUE and FALSE statements to 1 or 0 so that I could use custome formatting to edit what each cell displayes or hides without using the IF function.
My macro works to see if there is cell that the computer knows the answer to that I have not entered yet, copies the answer from the pencil marks, and puts it in the correct slot in the puzzle range.
I'm still a rookie at this so I typed it all out, not knowing how to create loops in macros yet.
Any suggetions as to what I can cut out, or how to change this to loop?
Background is that I'm working on an excel workbook to solve Soduko puzzels. I wanted to push my excel skills and see how I could use excel to mimic some tools other programs use to help beginners solve puzzels. So far things are going well.
-I have the Several 27*27 puzzel ranges set up,
--First starts in B2 and is a merged and copied down to a 9*9 grid. This is used to maintain the original puzzel so I can go back and start over,
--the second starts in AD2, this also is a 9*9 merge and copy that simply copies the the range from B2, I then can overwrite the formulas with my values here.
--The third in BF2 is a 27*27, this range creates the "pencil marks" showing what a each cell could be in the range AD2 based on the values in AD2.
--Finally (well not really but the others wont have any effect on this) there is CH2 a 27*27 that checks to see based off of the values in BF2 to see if there are any cells in AD2 that are not filled yet, but that there is a set value for it to be.
I've changed all TRUE and FALSE statements to 1 or 0 so that I could use custome formatting to edit what each cell displayes or hides without using the IF function.
My macro works to see if there is cell that the computer knows the answer to that I have not entered yet, copies the answer from the pencil marks, and puts it in the correct slot in the puzzle range.
I'm still a rookie at this so I typed it all out, not knowing how to create loops in macros yet.
Any suggetions as to what I can cut out, or how to change this to loop?