+ Reply to Thread
Results 1 to 4 of 4

Combine Private Sub and Private Function VBA code

  1. #1
    Registered User
    Join Date
    09-23-2018
    Location
    USA
    MS-Off Ver
    2017
    Posts
    26

    Smile Combine Private Sub and Private Function VBA code

    Hi all,

    I wrote two VBA codes:

    1st: generate all sames values for all filtered columns
    2nd: when there's no filter applied, the selected value applies to only one row, not for the whole column as 1st code

    I tried both code and they work perfectly but have two run twice SEPARATELY.

    Is there a way we can combine this so it runs by itself all together

    Please find code below.

    Thanks so much!!!


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Combine Private Sub and Private Function VBA code

    How/where are you using the IsFiltered function?

    Where would that fit into the other code?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-23-2018
    Location
    USA
    MS-Off Ver
    2017
    Posts
    26

    Re: Combine Private Sub and Private Function VBA code

    I am wondering if we can call IsFilter(ActiveSheet) for the main macro. Please share what you think is the best for this case. I really appreciate it!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Combine Private Sub and Private Function VBA code

    You can call IsFilter from anywhere you like, if you either change Private to Public or remove it and provided the code is in a standard module.

+ 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. [SOLVED] Combine Private Sub Worksheet_Change(ByVal Target As Range) VBA Code on same worksheet
    By mark_luke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2022, 04:48 PM
  2. Call Private Function under Private Sub
    By thanhthinh1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-25-2018, 03:23 AM
  3. [SOLVED] How to Combine two Private Sub Worksheet_Change ?
    By stoicy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-17-2016, 04:34 PM
  4. Private Worksheet change function conflicts with another Code...Help
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2015, 10:15 AM
  5. [SOLVED] Not sure how to combine two Private Sub Worksheet_Changes
    By sacastiglia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2014, 11:51 PM
  6. Combine Private Sub Worksheet_Change VBA Code on same worksheet
    By stanlelma in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2013, 12:42 PM
  7. [SOLVED] Private Function Code Change
    By Phil H in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-14-2006, 09:10 AM

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