Hello,
I have really coded myself into a corner and need help getting out. The first issue is that my spreadsheet is too large to post here, so I will post screenshots and code segments and anything else I can to help describe the issue.
The MAIN issue is that once the spreadsheet is set up and in use, if a sheet has to be deleted it destroys the whole spreadsheet. To clarify, amongst other sheets are 25 sheets in a row that contain the data of 25 people being logged. It looks like this:
Attachment 195916
Everything works perfect until someone leaves your department or is fired. If you delete their sheet, it messes up how several of the other sheets display their data. Here are some images to see why:
Attachment 195917
Attachment 195918
Here is some important info: I do have VBA already coded to HIDE sheets if there are less than 25 people being tracked. The code looks like this:
The end result is that when you initially set up the spreadsheet with 25 or 20 or 18 people, whatever number, you simply need to put that number of people in the box on the first page and the spreadsheet only shows information and calculates for that number of people.![]()
Please Login or Register to view this content.
Now- once you’ve been using this spreadsheet for a while and someone you have been logging moves to another department or is separated- THERE IS NO EASY WAY TO GET RID OF THEIR SHEET! If you hide the sheet manually, the data still shows up on all the other summary sheets. If you delete the sheet is throws errors into everything.What does work is as follows:
The only that works is a laborious process involving renaming every sheet after the one you want to remove, and then overwriting each sheet with the sheet after its data and renaming it accordingly. That sounds very confusing but I will try to explain better. If you have the sheets named: A, B, C, D, E, and F but no longer need to log for sheet B- the current process is to rename sheet C to C., D to D., E to E., and F to F. THEN copy the data from C over Sheet B (the one no longer needed) and rename sheet B to C (which is why you had to first rename C to C.). Then you have to copy sheet D and paste it over the data in sheet C and rename sheet C to D. Then you have to copy the data from sheet E over the… etc. Good grief! It takes forever.
So what happens at the end now that you have a sheet you were using but now don’t need due to the domino effect. That non needed sheet at the end is named with number. If you had 25 people (a full spreadsheet) and now have one not needed sheet at the end, that sheet would become named 25 and be hidden when the cell on the first page is set to show only 24 people now. If you start with 22 people sheets and are getting rid of one, the now not needed sheet at the end would need to be named 22 and would be hidden behind the sheets already hidden and named 23, 24, and 25.
Here is I think what I need- but perhaps there is a much better idea out there:
I need some VBA Code (which this is above my skill level) that if a user enters the current name of the sheet to be removed, the VBA goes through the above process of renaming all the sheets after the one entered, copies the data from the sheet after to the sheet before for every sheet after the entered one, and then renames all the sheets to correctly correspond with their new data, and lastly for the new not needed sheet at the end name it whatever number from 25 it now actually is.
The above paragraph is really what I’m after. I am happy to send any further detail, code, screenshots, and whatever I can to help out with this. The spreadsheet is too large to post on this site but I do have a dropbox account I think I can put it on if that is allowed.
I could truly use your help. Thank you for reading this ridiculously long post and your much valued time.
—Seth
Bookmarks