Hi all….I need some help adjusting some VBA code. The attached w/book is a sample (ie: month of January only). It works like this:
Workdays are shown as morning (white) and afternoon (sand color).If I have something scheduled for morning of Jan 5/11 (eg:row 23) and I want to re-schedule it to the afternoon of Jan 7 (row 33 or 34), I go to Y23 and enter 33 (or 34)….this will move the data from row 23 to row 33 (or row 34). It also works if I want to move something forward in time (eg: from Jan 10 to Jan 7)….the re-scheduling is done by entering the ‘new’ row number in column Y.
If you enter a row number where column C shows “closed” (eg: row 13-16 or row 75-78), you get a box saying that the row (aka ‘date’) is not a work day (eg: Jan 1, Jan 3, Jan 21).
I would like to be able to use column D in place of column Y (easier to view etc, especially as columns J-X widen once they have data in them). There are 2 parts of code that make all of this happen — you can view code on the Schedules sheet; it is the 2nd Private Sub that does part of the job. And, then in Module 2, you will see the code that does the rest of the job.
I am fairly sure that the 2nd Private sub only needs to have (“y:y”) changed to (“d:d”) and the line “Call Postpone(Target, 22)” (22 columns from Y to C) should probably be “Call Postpone(Target,1) (being 1 column from D to C).
I need help figuring out how to change the code in Module 2….as far as I can understand, the reference to -17 (in the line “If Cells(NewDateRow + i, iTargetCol – 17) = “” Then”) is the # of columns (17) moving right to left from Y to H (the first column of data that is being moved). If I use col D instead of col Y, I imagine that the -17 should be something like 4 (being 4 columns from D to H). And, I think that the line “For iCol=1 to 17” refers to the 17 columns to the left of Col Y (col X-H, moving right to left). I imagine that also would change b/c col Y will become col D (and the the columns being moved would be H-X (4-22).
I have made these changes but they’re not enough to make it work (so I undid the changes and restored the original code)……I am not sure, for example, if references to -iCol are a minus sign (and maybe should be a plus sign because I am moving left-to-right (from col D to X) or are they simpy acting as hyphens etc etc…..is someone able to fully decipher this code and suggest changes to it that will allow me to use Col D, rather than col Y, to do the ‘re-scheduling’ ? Thanks….