+ Reply to Thread
Results 1 to 8 of 8

HELP - Running Macros in VBA

Hybrid View

  1. #1
    Louise
    Guest

    HELP - Running Macros in VBA

    Why (&%¤#"!!!) are my macros in VBA not running? I have copied small Macros
    from reliable sources on the Internet to Modules in Excel, but I can't make
    them run?! What can I be doing wrong?

    One example:

    Sub DeleteBlankRows2()
    'Deletes the entire row within the selection if _
    some of the cells WITHIN THE SELECTION contain no data.
    On Error Resume Next
    Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
    On Error GoTo 0
    End Sub


  2. #2
    Don Guillett
    Guest

    Re: HELP - Running Macros in VBA

    I just placed this macro into a REGULAR module and it ran fine by f5 at the
    macro.

    Where did you put it and how are you trying to execute.

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Louise" <Louise@discussions.microsoft.com> wrote in message
    news:D06ADA6A-63E1-4722-BE3A-7CBDC1984CC2@microsoft.com...
    > Why (&%¤#"!!!) are my macros in VBA not running? I have copied small

    Macros
    > from reliable sources on the Internet to Modules in Excel, but I can't

    make
    > them run?! What can I be doing wrong?
    >
    > One example:
    >
    > Sub DeleteBlankRows2()
    > 'Deletes the entire row within the selection if _
    > some of the cells WITHIN THE SELECTION contain no data.
    > On Error Resume Next
    > Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
    > On Error GoTo 0
    > End Sub
    >




  3. #3
    Louise
    Guest

    Re: HELP - Running Macros in VBA

    I enter a workbook. Open the MVB editor. I put the code in a module (Insert >
    Module) in the Modules folder under the VBAProjects (PERSON.XLS), and I tried
    to run the Macro from the workbook which I have entered Microsoft Visual
    Basic through. Is this right?

    "Don Guillett" wrote:

    > I just placed this macro into a REGULAR module and it ran fine by f5 at the
    > macro.
    >
    > Where did you put it and how are you trying to execute.
    >
    > --
    > Don Guillett
    > SalesAid Software
    > donaldb@281.com
    > "Louise" <Louise@discussions.microsoft.com> wrote in message
    > news:D06ADA6A-63E1-4722-BE3A-7CBDC1984CC2@microsoft.com...
    > > Why (&%¤#"!!!) are my macros in VBA not running? I have copied small

    > Macros
    > > from reliable sources on the Internet to Modules in Excel, but I can't

    > make
    > > them run?! What can I be doing wrong?
    > >
    > > One example:
    > >
    > > Sub DeleteBlankRows2()
    > > 'Deletes the entire row within the selection if _
    > > some of the cells WITHIN THE SELECTION contain no data.
    > > On Error Resume Next
    > > Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
    > > On Error GoTo 0
    > > End Sub
    > >

    >
    >
    >


  4. #4
    JE McGimpsey
    Guest

    Re: HELP - Running Macros in VBA

    Are you putting the macro in a regular code module rather than a
    workbook or worksheet code module?

    Do you have your security set to something other than High?

    How are you trying to initiate the macro?



    In article <D06ADA6A-63E1-4722-BE3A-7CBDC1984CC2@microsoft.com>,
    Louise <Louise@discussions.microsoft.com> wrote:

    > Why (&%°Ë#"!!!) are my macros in VBA not running? I have copied small Macros
    > from reliable sources on the Internet to Modules in Excel, but I can't make
    > them run?! What can I be doing wrong?
    >
    > One example:
    >
    > Sub DeleteBlankRows2()
    > 'Deletes the entire row within the selection if _
    > some of the cells WITHIN THE SELECTION contain no data.
    > On Error Resume Next
    > Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
    > On Error GoTo 0
    > End Sub


  5. #5
    Louise
    Guest

    Re: HELP - Running Macros in VBA

    I enter a workbook. Open the MVB editor. I put the code in a module (Insert >
    Module) in the Modules folder under the VBAProjects (PERSON.XLS), and I tried
    to run the Macro from the workbook which I have entered Microsoft Visual
    Basic through. Is this right?

    "JE McGimpsey" wrote:

    > Are you putting the macro in a regular code module rather than a
    > workbook or worksheet code module?
    >
    > Do you have your security set to something other than High?
    >
    > How are you trying to initiate the macro?
    >
    >
    >
    > In article <D06ADA6A-63E1-4722-BE3A-7CBDC1984CC2@microsoft.com>,
    > Louise <Louise@discussions.microsoft.com> wrote:
    >
    > > Why (&%°Ë#"!!!) are my macros in VBA not running? I have copied small Macros
    > > from reliable sources on the Internet to Modules in Excel, but I can't make
    > > them run?! What can I be doing wrong?
    > >
    > > One example:
    > >
    > > Sub DeleteBlankRows2()
    > > 'Deletes the entire row within the selection if _
    > > some of the cells WITHIN THE SELECTION contain no data.
    > > On Error Resume Next
    > > Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
    > > On Error GoTo 0
    > > End Sub

    >


  6. #6
    JE McGimpsey
    Guest

    Re: HELP - Running Macros in VBA

    That should work.

    What about my other questions?

    In article <B62CF06C-226E-4F68-9ADA-6A75AA0942F6@microsoft.com>,
    Louise <Louise@discussions.microsoft.com> wrote:

    > I enter a workbook. Open the MVB editor. I put the code in a module (Insert >
    > Module) in the Modules folder under the VBAProjects (PERSON.XLS), and I tried
    > to run the Macro from the workbook which I have entered Microsoft Visual
    > Basic through. Is this right?


  7. #7
    Louise
    Guest

    Re: HELP - Running Macros in VBA

    > Do you have your security set to something other than High?
    I have set this to low

    > How are you trying to initiate the macro?

    I am trying to run it by Alt+F8 and then running it? Can it be something I
    have not installed?

    "JE McGimpsey" wrote:

    > That should work.
    >
    > What about my other questions?
    >
    > In article <B62CF06C-226E-4F68-9ADA-6A75AA0942F6@microsoft.com>,
    > Louise <Louise@discussions.microsoft.com> wrote:
    >
    > > I enter a workbook. Open the MVB editor. I put the code in a module (Insert >
    > > Module) in the Modules folder under the VBAProjects (PERSON.XLS), and I tried
    > > to run the Macro from the workbook which I have entered Microsoft Visual
    > > Basic through. Is this right?

    >


  8. #8
    JE McGimpsey
    Guest

    Re: HELP - Running Macros in VBA

    Are you sure the macro isn't running?

    If you set a breakpoint at the first line, is the sub entered? What
    happens when you step through it?

    Try removing the "On Error Resume Next" - do you get an error message?


    In article <080B9778-ABE0-44D8-8240-5278A76A56A7@microsoft.com>,
    Louise <Louise@discussions.microsoft.com> wrote:

    > > Do you have your security set to something other than High?

    > I have set this to low
    >
    > > How are you trying to initiate the macro?

    > I am trying to run it by Alt+F8 and then running it? Can it be something I
    > have not installed?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1