I am trying to adapt a macro I found online (‘Get_Hex1’ in the attached) that displays the colors of a selected character in hex form and writes the results to the immediate window (‘Get_Hex2’). My desire was originally to have the results display in a message box in the same way they appear in the immediate window. I couldn’t get that to work, so I changed the output to an Excel sheet.
That works fine, except that the loop creates two extra rows with redundant data. I couldn’t figure out how to prevent that from happening, so I then focused on just deleting the two extra rows from the worksheet. That works fine the first time I run the macro ‘Get_Hex2’, but in each successive run, the extra rows are not removed. Only if I close the document and reload it will ‘Get_Hex2’ remove the two extra rows.
I’ve run out of ideas for making this work, either by preventing the macro from creating the two extra rows in the first place, or by removing those extra rows in the Excel sheet. Can someone give me an assist here?