Hide Rows if cell value is

I would like to hide a row if certain values are entered in three cells. For
e.g. if United Kingdom is selected in Cell C3 and C5 and CI is selected from
cell C10, I would then have Row 16 hidden. I would like this to be
dynamically i.e. updated whenever the value in the cell changes.

Many thanks in advance.

-- 
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-new/200605/1
0
mohd21uk
5/16/2006 1:19:06 PM
excel.newusers 15348 articles. 2 followers. Follow

1 Replies
359 Views

Similar Articles

[PageSpeed] 47

Hi Mohd,

Try:

'=============>>
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range

    Set rng = Me.Range("C3,C5,C10")

    If Not Intersect(rng, Target) Is Nothing Then
        Rows(16).EntireRow.Hidden = Range("C3").Value = _
                    "United Kingdom" And Range("C5").Value = _
                    "United Kingdom" And Range("C10") = "C1"
    End If
End Sub
'<<=============

This is worksheet event code and should be pasted into the worksheets's code 
module (not a standard module and not the workbook's ThisWorkbook module):

Right-click the worksheet's tab
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman



"mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message 
news:6056580dee09e@uwe...
>I would like to hide a row if certain values are entered in three cells. 
>For
> e.g. if United Kingdom is selected in Cell C3 and C5 and CI is selected 
> from
> cell C10, I would then have Row 16 hidden. I would like this to be
> dynamically i.e. updated whenever the value in the cell changes.
>
> Many thanks in advance.
>
> -- 
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.aspx/excel-new/200605/1 


0
normanjones (1047)
5/16/2006 2:23:27 PM
Reply:

Similar Artilces:

hide CEO mailbox
Is there is away to hide a mailbox from the GAL, not by using Hide from Exchange address lists “ exchange advanced tab” in exchange 2003 ? Our CEO would like to hide his name from general public in the GAL but at the same time, he wanted to make sure some of dept ( lawyers dept or VPs) can find him in the GAL. he only want certain people can view his name in the GAL. so i was wondering is there any ways we can modify in the Security to restrict users to view his information in the GAL ? you could create a "restricted" address list, perhaps, or perhaps instead, set delivery...

Replace a comma with a period in a cell containing a lastname, first name, middle i
Hello - I am trying to clean some data and need to change all of my names from McLaughlin, Victor, (i.e, comma) W to McLaughlin, Victor.(i.e., period) W Is there an extract and replace formula or method of som sort (in excel or access) that will allow me to pull the first comma from the right and replace it with a period. Thanks for any suggestions! Select the cells you want to change and run this tiny macro: Sub comma_tose() For Each r In Selection v = StrReverse(r.Value) r.Value = StrReverse(Replace(v, ",", ".", 1, 1)) Next End Sub For example: a,b,c,d wi...

Combine multiple rows into one row with multiple columns
Hi, I have a table set up so that there are three columns: StudyID, DrawDate, and Value. StudyID and DrawDate are the primary key. I want to create a table from this one that has only one row for each StudyID so that it would go from: StudyID DrawDate Value to StudyID DrawDate1 Value1 DrawDate2 Value2 DrawDate3 Value3 etc. Is there a way to do this? Thanks, Elysia "Elysia Larson" <elysia.larson@gmail.com> wrote in message news:832e952f-174f-489f-ab7a-e2189f660a92@f6g2000vbp.googlegroups.com... > Hi, > > I have a...

Problems with re-setting the last active cell in an Excel workshee
I am trying to re-set the last active cell on an Excel 2002 worksheet (in this particular sheet it should be cell DA197). I have used both the methods described in the Knowledge Base article (deleting rows and columns and re-saving; and the Excess Format Cleaner add-in). Deleting the rows and columns does not work; using the Excess Format Cleaner does not work either and it then also hides the rows from 198 to 65536 - but does not do the same for the columns. I have checked that there is no protection on the worksheet. Has anyone else come across this problem and if so can you please ...

Column to Rows
I want to convert my data from one column into rows. I have my data set up now as follows: John Smith $3200 555 Main St. 95111 Jane Jones $5500 345 Happy Dr. 93434 Jack Clark $2300 354 Oak Pl. 95343 I want it to be displayed into 4 separate columns as follows: John Smith $3200 555 Main St. 95111 Jane Jones $5500 345 Happy Dr. 93434 Jack Clark $2300 354 Oak Pl. 95343 Please advise, thanks, Don -- Don D. ------------------------------------------------------------------------ Don D.'s Profile: http://www...

Charts switch from 'Series in Rows' to 'Series in Columns'
I use VBA to create charts in Excel 2003, but find that sometimes the Charts switch 'Series in Rows' (intended) to 'Series in Columns' (not intended), even if I have specified 'Series in Rows'. This happens intermittently, and I am not sure what I am doing wrong. I do save the workbook as Microsoft Excel 97 so that a user with Excel 2000 or Excel 2003 can use the workbook. Thank you for any suggestions. Hard to tell if you keep the code secret. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Peac...

How can I initialize the value?
template < class elemType > class MyArray { public: explicit MyArray( int size = DefaultArraySize ); MyArray( elemType *array, int array_size ); MyArray( const MyArray &rhs ); virtual ~MyArray() { delete [] ia; } bool operator==( const MyArray& ) const; bool operator!=( const MyArray& ) const; MyArray& operator=( const MyArray& ); int size() const { return _size; } virtual elemType& operator[](int index) { return ia[index]; } virtual void sort(); virtual elemType min() cons...

Complex (for me) checking values in fields to perform calcs in others
Hi all.. I am creating a Cash Flow Projection report in access that inspects the "completed dates" of sheduled draws to calculate a remaining balance, but I am having problems with it. The idea is: --------------------- Iff [Draw1CompletedDate] = Null then Me!txtBalance = [MortgageAmount] Else If [Draw1CompletedDate] <> Null AND [Draw2CompletedDate] = Null then Me!txtBalance = [MortgageAmount] - [Draw1Amount] Else If [Draw1CompletedDate] <> Null AND [Draw2CompletedDate] <> Null AND [Draw3CompletedDate] = Null then Me!txtBalance = [MortgageAmount] - [Draw1Amoun...

tasks to cell phone
How can I use exchange to send tasks to cell phone. I want to do when f.e. this phone is away from the office. This is PDA phone. On 14 Dec 2005 11:38:11 -0800, "Filip - beginner" <fwitkowski@gmail.com> wrote: >How can I use exchange to send tasks to cell phone. I want to do when >f.e. >this phone is away from the office. This is PDA phone. If you're using a Smartphone you can sync tasks already with ActiveSync. "Mark Arnold [MVP]" <mark@mvps.org> wrote: >On 14 Dec 2005 11:38:11 -0800, "Filip - beginner" ><fwitkowski@gmail...

Replace Cells with Column names in functions?
I have a # of fairly long/complex cell functions that get hard to debug because there are also a lot of rows. Is there anyway to change display so it replaces the column name e.g. If(BT1204="X". BA="Y" to If(CustomerName="X", CustomerCode="Y") ? CustomerName is a defined name range for BT1204 Find & Replace Find what: BT1204 Replace with: CustomerName "msnyc07" wrote: > I have a # of fairly long/complex cell functions that get hard to debug > because there are also a lot of rows. > > Is t...

How to convert a Chinese registry value from within a US code page?
First of all, our Win32 MFC VC++ app is not written in Unicode as it should have been. Given that - it reads uninstall information from the windows Uninstall registry tree and writes it to a report. It writes out the displayname of the application. Normally this is not a problem, but when it encounters a Chinese application name, it displays the name as question marks. I assume this is because the string is in Unicode in the registry, but our app is not Unicode so it can't represent the characters. Unfortunately for the moment, converting this very large app to Unicode is not an o...

Calendar in Cell Validation
I want to implement a cell validation such that when the user attempts to input a date, a "list" box-like functionality pops up that has a calendar and the user may then choose the date by picking with the mouse How would I implement this? Thanks Jerry Try the following Web site. http://www.fontstuff.com/vba/vbatut07.htm This site's author covers this in a tutorial, but also provides downloads. Mark <jerry.ranch@pioneer.com> wrote in message news:2r9t51pjmumjk7rjpopo7fuamg81gqkljq@4ax.com... >I want to implement a cell validation such that when the user attempts &g...

extract info from cell, then count
I have a 2-part question: (i) I have 1000's of e-mail addresses but want to extract the countr from the e-mail i.e. abc@def.de, where de (Germany) is needed. How d I isolate the ".de" (and others eg .fr, .edu, .com etc etc) (ii) Having done the above, I then need to do a count. Rather than us COUNTIF and include the code for every country in the world, is ther any other way of counting? I guess a Pivot table? thanks, cathal..... -- Message posted from http://www.ExcelForum.com One way: =MID(A1,FIND("^",SUBSTITUTE(A1,".","^",LEN(A1)-LE...

Can I use VBA to add cells (over blanks) then do multiplication
I have a Word table in which the last column contains numbers (3 and 4) and some bank cells and I want it add them and put the total into the second last row (7 in this case). The last row contains a multiplier (3) which when applied to the total results in 21. Below is the table. | | | 3 | | | | | | | | 4 | | | | 7 | | | 3 |21| How can I achieve this in VBA (under Word 2003 and 2007) remembering that the user can add rows to the table and the last column can contain blank cells. Thanks in advance for any assistance, Peter Evans Sub ScratchMaco(...

Row Grand Totals in Pivot Tables?
I'm working in Excel 2007 and I can't seem to see my row grand totals in my pivot table. I can see the grand totals on the columns, but no rows. Any ideas? Hi adodson See if the article at http://www.techonthenet.com/excel/pivottbls/gtotal_col2007.php does what you want. Regards, Pedro J. > I'm working in Excel 2007 and I can't seem to see my row grand totals in my > pivot table. I can see the grand totals on the columns, but no rows. Any > ideas? Yeah, that is what I would expect it to do too. However, I set that option and don't receive the total. ...

Default Value problem 02-22-08
Feel a bit silly. I want to insert a =Now() Date field on every new record created via a certain form. I don't want people seeing this info. So, I added AphaDate Date field to the table the query for this form is based on. I insert the field on the form and mark it hidden. In the properties for this field on the form, I say the default value =Now() I assume then that any new record created will "stamp" with this date. But it doesn't work When I create the table, add the field to the query and try to set this up, the field shows up as blank no matter what I do. Wha...

Conditional Formatting
Is it possible to format a portion of a text string within a cell (as opposed to the entire cell). For example, I would like to format the word 'gift' in red font anywhere it a appears in range C2:C417 but only that word, not the entire cell. Not with conditional formatting. But you could change the actual format for that word (or group of characters)... Saved from a previous post (or two!): If you want to change the color of just the characters, you need VBA in all versions. You want a macro???? Option Explicit Option Compare Text Sub testme() Application.ScreenUpdating ...

VBA to add and remove text within cells
Hi, I have a field named "Postal" at the top of column F that always include a number with 5 digits then a city name then a region name, such as "11090 CARCASSONNE Linguadoca-Rossiglione". I need to create a program to have this field changed as following : "F-11090", then copying "CARCASSONNE" into the City field which is empty (column G). The city name is always starting just one space character after the postcode, same thing for the region name, it always starts one space character after the city name. The region has to be removed completely. ...

Doing a VLOOKUP (probably using the INDEX and MATCH function), with both vertical and horizontal values in play.
I am trying to create a function that will pull in data from a 2nd spreadsheet. Typically, I use the index and match function to do so. However, in this case, I am trying to do a lookup based on a value above (i.e., horizontal) and a value to the right (i.e., vertical) of the cell in which the formula will be placed. Additionally, the sheet from which I am pulling is similarly laid out. To Provide an example. Lookup Table Months (horizontal) Jan Feb Mar Apr Etc Names(vertical) Jeff Eric 5 Steve ...

Finding Cells that Total a Value
Hello Friends, I need some assistance in solving a problem. I have a spreadsheet with over five hundred lines of transactions. The sum of these transactions are creating a balance on the account. Is there any formula/macro that will help me find the transactions creating the balance? The sum of the account should be zero. To clarify, if we owe client money, there would be a transaction setting up that postive balance then a payment on the account taking it back to zero. There could be multiple transactions and then one net payment. Or we could be due to receive. So at the end of the day, th...

Excel Row as Header
I am making a table and the top row has all the headings for each column. I want this row of headings to appear on each page, since the table extends to 3 pages and users will be adding rows frequently. Is this possible, and if so, how? thank you Hi Kat, If you are refering to printed pages, then: File > Page Setup Then select the 'Sheet' tab and enter your heading row where it says 'Rows to repeat at top'. I use XL2000. Other versions might be slightly different. Regards - Dave. And if you're referring to the screen: Select cell A2 Window>Freeze Panes -- Ki...

go to cell with date equaling TODAY()
Hello! I have a spreadsheet with January 01, 2006 thru December 31, 2006 in ascending order in column A, each date in a different cell (A1, A2, A3, etc.). I don't enter data into this sheet everyday..in fact, months could go by before having to enter an occurance for say, March 31. Is there a way to have excel, upon opening the spreadsheet, advance the cursor to the cell with that day's date in it? -- Thank you all for your help! Using function Date rather than Today() Works for me. Private Sub Workbook_Open() Dim r As Long Dim T As Long T = Date r = Application.Matc...

Formatting cell for phone numbers
I am trying to format a cell with phone numbers so that it will look like the following: (937) 123-3456 (937) 129-9876 fax or (937) 123-3456 The word 'fax' is more specifically a label, not necessarily that word. I would like to have carriage returns between the numbers with the possibility of several numbers. This may be confusing and/or too complicated, but I'd like to give it a try. If anyone as suggestions or possible solutions, I would appreciate hearing them. Thanks, Craig >-----Original Message----- >I am trying to format a cell with phone numbers so that ...

Cell format options are truncated
When you click on any cell and click to format it, tabs do not display properly. Are you editing the cell at the time? You may only see the Font tab if that's the case. Make sure you're not in edit mode before you click on Format|Cells... maria.garciavelazquez@gmail.com wrote: > > When you click on any cell and click to format it, tabs do not display > properly. -- Dave Peterson ...

Sum a table of columns & rows
I have a spreadsheet of 154 Rows (all unique project numbers in numerical order) and 9 columns of account numbers (some are similiar and some are user entered, therefore there could be 'blanks' with no data in them). I am trying to create a table that will only give me the project number if there are dollars in one or more of the columns. This would be used for data entry (and that is why I would like to have the columns summed up - to remove duplicates). Any ideas? I have given a brief example below: F, G, &am...