Relative Content

Tag Archive for excelvbamacros

How do I write a VBA excel macro to format graphs?

I found part of this macro online and copied it letter for letter. The video unfortunately cuts off the code so I can’t see the bottom of the document. I tried to accomplish making a macro for the graph formatting originally by recording clicks but it didn’t work. When I run this code it says “Compile error: Unexpected End with”.

Looking for a VBA solution: How to Selectively Copy and Save Worksheets based on Worksheet Titles

My organization publishes a weekly report in Excel format containing over 60 worksheets, each titled with an activity abbreviation. I am interested in specific worksheets only. Currently, I manually search and copy these worksheets into a new workbook. Existing VBA solutions appear to require predefined worksheet names in an array, which will not work in my case because when there is no activity, a corresponding worksheet titled with the activity code is not included in the workbook.

Copying data from destination tab to source tabs automatically

I have a macro in excel that copies data from 5 tabs into one tab that is the master data file, and then into another where it hides some columns. Each time the macro is being ran, it deletes all the data from the two destination tabs. Everything works fine, but I would like to have an option to manually enter a comment in the destination tab and have it copied to the source tab. Is it even possible without altering the macro dramatically? The columns that are being hidden might be changed in the future and I would like to avoid having to change the macro every time they are.

Search and select file in opened folder

I found a script and modified it to search for a filename in a folder and select the filename.
This code works fine when I use Shell "explorer.exe /select,""" & FilePath & """", vbNormalFocus to open the folder and select the filename. However, it keeps opening a new folder instance instead of using the currently opened folder.
I tried to use this code:

Macro to add code to individual Excel worksheet

I have written the macro below to export data to separate files (a single table / single worksheet to one workbook) that works fine. I am attempting to add code to the worksheet to highlight updates made by users to the values in the exported worksheet. I can add the code to the workbook, as illustrated, where it does not work, but cannot tweak the macro to add the code to the worksheet, where it does work.
Please point out my coding error!