Having a VBA problem when writing an EXCEL macro

David Hill 100 Reputation points
2026-06-13T14:42:56.2566667+00:00

Tell me how I can send you an EXCEL file which details the gist of my problem.

Developer technologies | Visual Basic for Applications

2 answers

Sort by: Most helpful
  1. AI answer

    2026-06-13T14:43:04.52+00:00

    Excel files cannot be sent here directly. To get help with a VBA problem, save the workbook and then describe the issue in text, including:

    1. A short description of what the macro should do and what actually happens.
    2. Any error messages, including the exact text and when they appear.
    3. The relevant VBA code: open the Visual Basic Editor with ALT+F11, copy the specific procedure (Sub/Function) that is failing, and paste it into the question.
    4. Any special setup details (Excel version, whether the macro is in a personal macro workbook, whether the file is on a network location, etc.).

    If the problem involves macros not running or being blocked, also include the current Trust Center macro settings from Excel.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    10 people found this answer helpful.
  2. ReHaN AhMaD 0 Reputation points
    2026-06-25T13:59:43.0966667+00:00

    Hi @David Hill,

    You cannot directly upload or attach raw Excel files (.xlsm or .xlsx) here due to security and platform limitations. However, you can share your problem and code using the following alternative methods:

    1. Upload your sample Excel file (make sure to remove any sensitive or personal data) to a cloud drive like OneDrive, Google Drive, or Dropbox.

    Generate a shared link (set it to "Anyone with the link can view").

    Paste that link here in a comment or update your question.

    Method 2: Share the VBA Code Directly

    If the problem is purely with the macro code:

    Press ALT + F11 in Excel to open the Visual Basic Editor.

    Copy the specific Sub or Function code that is causing the error.

    Paste it here using the Code Block ({}) tool in the formatting toolbar so it's readable.

    Method 3: Share Screenshots

    You can take a screenshot of the error message or your data layout and upload it directly using the Insert Image icon in the reply editor.Hi @David Hill,

    You cannot directly upload or attach raw Excel files (.xlsm or .xlsx) here due to security and platform limitations. However, you can share your problem and code using the following alternative methods:

    Method 1: Share via Cloud Storage

    Upload your sample Excel file (make sure to remove any sensitive or personal data) to a cloud drive like OneDrive, Google Drive, or Dropbox.

    Generate a shared link (set it to "Anyone with the link can view").

    Paste that link here in a comment or update your question.

    Method 2: Share the VBA Code Directly

    If the problem is purely with the macro code:

    Press ALT + F11 in Excel to open the Visual Basic Editor.

    Copy the specific Sub or Function code that is causing the error.

    Paste it here using the Code Block ({}) tool in the formatting toolbar so it's readable.

    Method 3: Share Screenshots

    You can take a screenshot of the error message or your data layout and upload it directly using the Insert Image icon in the reply editor.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.