Results 1 to 10 of 10

Change code to look for current worksheet?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-08-2011
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2007
    Posts
    123

    Change code to look for current worksheet?

    I need help changing code to look for the current worksheet. Excel is looking for the worksheet I used while creating the macro.

    This is what the code currently looks like:

    Sub LAUREN3()
    '
    ' LAUREN3 Macro
    '
    
    '
        Columns("E:E").Select
        Application.CutCopyMode = False
        Selection.Insert Shift:=xlToRight
        Range("E1").Select
        ActiveCell.FormulaR1C1 = "CAR MARK"
        Range("E2").Select
        ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],"" "",RC[-1])"
        Selection.AutoFill Destination:=Range("E2:E2574")
        Range("E2:E2574").Select
        Columns("E:E").Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("A1:L2574").Select
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("EDITED3").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("EDITED3").Sort.SortFields.Add Key:=Range( _
            "B2:B2574"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
            xlSortNormal
        With ActiveWorkbook.Worksheets("EDITED3").Sort
            .SetRange Range("A1:L2574")
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    Last edited by dalewms2; 08-08-2011 at 03:31 PM.

Thread Information

Users Browsing this Thread

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

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