+ Reply to Thread
Results 1 to 2 of 2

Text disappears after Macros runs

  1. #1
    Registered User
    Join Date
    11-26-2019
    Location
    St Louis, Mo
    MS-Off Ver
    2016
    Posts
    1

    Text disappears after Macros runs

    I am trying to write a Macros that will hide columns and uncheck a few drop downs. I have the macros recorded and when I run it all the data in the workbook disappears. Here is a sample of my code just curious to why this is happening. Thanks in advance

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Excess Space
    '
    ' Keyboard Shortcut: Ctrl+Shift+A
    '
    Columns("A:A").Select
    Range("A3").Activate
    Selection.Delete Shift:=xlToLeft
    Selection.NumberFormat = "0.00"
    Selection.NumberFormat = "0.0"
    Selection.NumberFormat = "0"
    ActiveWindow.SmallScroll ToRight:=11
    ActiveSheet.Range("$A$4:$AK$271").AutoFilter Field:=12, Criteria1:="=CMB", _
    Operator:=xlOr, Criteria2:="=MTB"
    ActiveSheet.Range("$A$4:$AK$271").AutoFilter Field:=15, Criteria1:="="
    ActiveSheet.Range("$A$4:$AK$271").AutoFilter Field:=18, Criteria1:= _
    "=Leased", Operator:=xlOr, Criteria2:="=Owned/Ground Lease"
    Columns("S:S").Select
    Selection.NumberFormat = "m/d/yyyy"
    Columns("T:T").Select
    Selection.ColumnWidth = 15
    ActiveWindow.ScrollColumn = 13
    ActiveWindow.ScrollColumn = 14
    ActiveWindow.ScrollColumn = 15
    ActiveWindow.ScrollColumn = 16
    ActiveWindow.ScrollColumn = 17
    ActiveWindow.ScrollColumn = 18
    ActiveWindow.ScrollColumn = 19
    Columns("U:AI").Select
    Selection.EntireColumn.Hidden = True
    Columns("AK:AK").Select
    Selection.EntireColumn.Hidden = True
    ActiveWindow.SmallScroll ToRight:=-13
    Columns("G:J").Select
    Range("G3").Activate
    Selection.EntireColumn.Hidden = True
    Columns("L:P").Select
    Selection.EntireColumn.Hidden = True
    ActiveWindow.SmallScroll ToRight:=-5
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Text disappears after Macros runs

    Please see the yellow banner at the top of the page.

    Also ...

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional.)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Run multiple macros after another macro runs
    By Jamesraywebber85 in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 02-08-2019, 08:24 PM
  2. VBA code that runs all macros in a folder
    By akenney151 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2018, 02:37 PM
  3. [SOLVED] Control automatic runs of macros
    By LAVA2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2015, 01:06 PM
  4. Making a macro that runs other macros
    By worthm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2014, 05:34 PM
  5. [SOLVED] What goes between 2 macros so one runs right after the first?
    By ILoveStMartin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 01:34 AM
  6. Excel runs really slow after macros. help!!
    By excelnoobie123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2010, 04:35 AM
  7. How to stop other macros while current macro runs
    By Paul987 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2006, 12:20 PM

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