Help With A Lost Macro

Copper Contributor

Hello Kind Community:

I am an octogenarian that needs help with a lost Macro; but first I have some questions that are bugging me: (1) Why do I have multiple PERSONAL.xlsb files in the folder C:/Users/Jerry/Appdata/Roaming/Microsoft/Excel/XLSTART? I assume that because they also contain words like Autosaved and AutoRecovered, they arose from glitches. They contain Macros but not the one that I seem to have lost. Further, the one that opens when I open Excel is the one with the most recent date. This leads to my next question. (2) When I open Excel, that PERSONAL file remains open and visible. I thought that the PERSONAL file works in the background. (3) Note the content of the Macro captured image. There are 2 macros FormatLinkedInExportFile and FormatNewLinkedInExportFile. These should remain.

 

Now to the guts of my question. I had a Macro that no longer exists. It was CountCellsByColor. The range, which is dynamic, is currently M3:M7599. The formula =CountCellsByColor(M3:M7599,L7602)+M7601 is in M7602. L7602 contains the color (BLACK) to be evaluated. So, to further explain, the range contains both number cells and color cells. M7601 is the sum of the number cells. The formula is supposed to count the number of color cells in the range and add it to the sum of the number cells. Right now the formula evaluates to #NAME?. Can the macro that I described be easily recreated?

 

I also wish to use the same macro for a new column that has been created (Column N). The same relative cells would be utilized as in Column M and the color to be evaluated (YELLOW) would be in O7602. Can this be easily done?

 

Thanks in advance for all of your assistance. Please let me know if there are any questions.

1 Reply

@JbScG_2 Lets take this one step at the time.

1. Clean out XLSTART

- Close Excel and move all files from XLSTART to another folder where you can easily find them

- Open these files in Excel

- Compare the modules and macro's in all of them (easiest to do in the VBA editor)

- If you find a macro in any of the ones not called personal.xlsb which you need to keep, copy that one over to personal.xlsb. Perhaps the CountCellsByColor function is there too.

- Once you've salvaged the macro's you need, close all of them but only save personal.xlsb

- Open the personal.xlsb and click the View menu. Click the Hide button.

- The file seems to disappear, but don't worry, just close Excel. It should prompt whether you want to save the file. Click Yes.

- Now copy the updated Personal.xlsb back to your XLSTART folder

- Make sure to delete all other files in that folder

2. Fix #Name error

- Open the file which uses this function

- Choose Data, Edit links

- Personal.xlsb is likely in there, click it and choose change source and navigate to personal.xlsb in your XLSTART folder.