+ Reply to Thread
Results 1 to 19 of 19

VB Range Code

Hybrid View

giraud VB Range Code 07-16-2018, 01:19 PM
shg Re: VB Range Code 07-16-2018, 01:33 PM
giraud Re: VB Range Code 07-16-2018, 01:50 PM
davesexcel Re: VB Range Code 07-16-2018, 01:35 PM
visualnotsobasic Re: VB Range Code 07-16-2018, 01:35 PM
shg Re: VB Range Code 07-16-2018, 01:38 PM
Richard Buttrey Re: VB Range Code 07-16-2018, 01:39 PM
Norie Re: VB Range Code 07-16-2018, 01:45 PM
visualnotsobasic Re: VB Range Code 07-16-2018, 01:58 PM
Norie Re: VB Range Code 07-16-2018, 02:19 PM
visualnotsobasic Re: VB Range Code 07-16-2018, 02:49 PM
davesexcel Re: VB Range Code 07-16-2018, 02:32 PM
Richard Buttrey Re: VB Range Code 07-16-2018, 02:40 PM
giraud Re: VB Range Code 07-16-2018, 03:25 PM
davesexcel Re: VB Range Code 07-16-2018, 04:04 PM
Norie Re: VB Range Code 07-16-2018, 04:22 PM
giraud Re: VB Range Code 07-16-2018, 06:44 PM
Richard Buttrey Re: VB Range Code 07-17-2018, 05:37 AM
giraud Re: VB Range Code 07-18-2018, 03:35 PM
  1. #1
    Registered User
    Join Date
    07-16-2018
    Location
    Wisconsin
    MS-Off Ver
    365
    Posts
    5

    Re: VB Range Code

    Here is my workbook, remember i have no schooling on this, so no laughing.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VB Range Code

    As suggested in my post #6 put the following formula in AI4 and copy down to AI52
    Formula: copy to clipboard
    =IF(OR(A4="",Q4=""),"Hide","")


    Now your sheet activate event is

    Private Sub Worksheet_Activate()
     Dim r As Range
     Application.ScreenUpdating = False
    
        Range("$AI$3:$AI$53").AutoFilter Field:=1, Criteria1:="<>"
        Set r = Range("$AI$3:$AI$53").SpecialCells(xlCellTypeVisible)
        Range("$AI$3:$AI$53").AutoFilter
        r.Rows.Hidden = True
      Application.ScreenUpdating = True
    
    End Sub
    see attached
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-16-2018
    Location
    Wisconsin
    MS-Off Ver
    365
    Posts
    5

    Re: VB Range Code

    Thanks you for the help, it works perfect. I understand what your previous post meant now.

    Much appreciated.

+ 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. edit in code for populate range of cell in list box and code for delete any items
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2017, 03:33 PM
  2. [SOLVED] Code to open each WB and run code, by range value then save and close the wb
    By bezbid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2016, 11:05 AM
  3. Replies: 3
    Last Post: 01-06-2016, 10:04 AM
  4. [SOLVED] My code is not dynamic; it has a pre-defined range. Possible to change code?
    By mick0005 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-20-2015, 10:23 PM
  5. Re-code Userform to open range of sheets like previous sheet code
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2014, 02:31 AM
  6. Protect/Unprotect code causing out of range error in code
    By Petrolcb41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2010, 02:34 PM
  7. Optimizing the Vlookup code in VB. Repitive code with different referencing range.
    By raknahs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2010, 05:03 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