+ Reply to Thread
Results 1 to 3 of 3

Need help to debug some basic VBA steps

  1. #1
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Need help to debug some basic VBA steps

    I am using the record macro function to compile a list of instructions to run. I am just doing them manually and copying/pasting the VBA code being produced. But when I run the actual code, I'm getting an error and not all the steps run. Can anyone help on this? I attached the code in .doc format. I'm rather new to VBA so forgive the amateur level. The highlighted line is coming back as a Debug error.
    Attached Files Attached Files
    Last edited by NYC4LIFE; 07-30-2013 at 12:30 PM. Reason: attached instructions in .txt

  2. #2
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Need help to debug some basic VBA steps

    Have you rename your sheets ?
    Please consider adding a * if I helped

  3. #3
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Need help to debug some basic VBA steps

    no. i managed to get some steps working. I'm trying to use a sort function across 5 parameters. the record macro function yields the below code, but when trying to re run it, I get an error to Debug the highlighted line. Can anyone offer help on this? I can't seem to get it to work


    Sub rec3()
    ActiveCell.Cells.Select
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, 12).Range("A1:A11032"), SortOn:=xlSortOnValues, Order:=xlAscending _
    , DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, 7).Range("A1:A11032"), SortOn:=xlSortOnValues, Order:=xlAscending _
    , DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, 11).Range("A1:A11032"), SortOn:=xlSortOnValues, Order:=xlAscending _
    , DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, 9).Range("A1:A11032"), SortOn:=xlSortOnValues, Order:=xlAscending _
    , DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, 13).Range("A1:A11032"), SortOn:=xlSortOnValues, Order:=xlAscending _
    , DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
    .SetRange ActiveCell.Offset(-1, 0).Range("A1:ER11033") .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Requesting help in Excel Macro Tutorial/Basic Steps in creating a Macro in Excel
    By rhaiyan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2013, 09:21 PM
  2. how to programatically do lot of steps
    By naeemdotcom in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-09-2011, 06:48 AM
  3. [SOLVED] steps to eM URL?
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 03-05-2006, 04:10 PM
  4. [SOLVED] steps to display .wmf ?
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 03-02-2006, 06:30 PM
  5. Baby steps
    By oberon.black in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2005, 02:43 AM

Tags for this Thread

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