+ Reply to Thread
Results 1 to 6 of 6

How to create a conditional command in VBA based on a cell value?

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    Cairo, Egypt
    MS-Off Ver
    Excel 2010
    Posts
    9

    How to create a conditional command in VBA based on a cell value?

    Hi guys,

    I want to hide some rows in a sheet based on the value of a cell in another sheet in the same workbook.

    Please help me with the VBA script.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How to create a conditional command in VBA based on a cell value?

    You may use:
    Please Login or Register  to view this content.
    or simply:
    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    02-06-2014
    Location
    Cairo, Egypt
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to create a conditional command in VBA based on a cell value?

    Thank you,

    the only problem it shows an error: "Compile error: invalid outside procedure"

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How to create a conditional command in VBA based on a cell value?

    It must be placed within Sub..End Sub lines - I believed this to be part of a larger routine:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-06-2014
    Location
    Cairo, Egypt
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to create a conditional command in VBA based on a cell value?

    Thank you, that was really helpful

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: How to create a conditional command in VBA based on a cell value?

    You are welcome.

    Please remember to select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. I need to create a conditional paragraph based on the value of a cell...
    By drgray7 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-25-2013, 01:47 PM
  2. Using a macro to create a conditional format based on a date in a cell
    By srsev in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2012, 04:39 PM
  3. IF Command based on cell or IF/AND command -HELP needed
    By lsafri in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-30-2012, 08:42 AM
  4. use vbasic to create icon conditional formating based on other cell values?
    By flyboy54 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2012, 02:56 PM
  5. Create Command Buttons based on Worksheet Names
    By Qppg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-20-2010, 12:53 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