Extra Code To Hide Columns

Jul 25, 2013

Below code isnt working for "5 Metre", columns dont hide from row 24 down.

My A10 is a drop down where i select 5 or 6 or 7 metre. If i select 5 it only hides rows 22 and 23.

I think the 2nd and 3rd lines marked red are stopping the rows from hiding!

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$10" Then
Rows("22:40").Hidden = (Target.Value = "5 Metre")
Rows("24:40").Hidden = (Target.Value = "6 Metre")
Rows("26:40").Hidden = (Target.Value = "7 Metre")
End If
End Sub

View 2 Replies


ADVERTISEMENT

VBA Code To Hide Columns In Spreadsheet When Run?

Feb 9, 2012

I need some VBA code to hide columns in spreadsheet when run. Basically, in row 7, I've entered HIDE in the columns that I want to hide when the macro runs (i.e. columns F,J,H,I,K, O,P,R).

View 7 Replies View Related

VBA Code To Hide Columns Except Highlighted

Feb 14, 2014

VBA code that can highlight all columns except ones highlighted?

View 1 Replies View Related

Code To Hide Columns Based On Value Of Another Column

Jul 31, 2014

with a simple code that could:

If column K2:k466 is blank or says "No" then columns L & M are hidden. If it says "Yes" it is not hidden.

Also,

If Column N2:N466 is blank or says "No" then Columns O,P,Q,R are hidden. If it says "Yes" they are not hidden.

Finally,

If Column V2:V466 has a zip code (or number) then columns T,U,W,X,Y,Z,AA,AB,AC are present. If there is no value in any of V2:V466 then they are hidden. .

View 12 Replies View Related

VBA Code To Hide Columns To Left And Center Worksheet

Sep 4, 2013

I have a worksheet in excel that I have hidden columns from AA right to the end. Which gives the user a nice worksheet with everything to the right of AA hidden in blue. What I would like to do is now centre the worksheet in the screen and have the same hidden blue effect to the Right of the worksheet in this blue.

View 1 Replies View Related

Inserting Extra Code...

Apr 7, 2009

I have an excel sheet which contains the data in blue. In another sheet I have the same data but with an extra code (red). For my question I have put both in one sheet. My problem is that I need to combine the extra code info in the sheet with the blue data. Both the blue column and first red column are identical.

View 4 Replies View Related

Edit Code To Add Extra Criteria

Feb 22, 2008

How do I make this formula include searching for "ann" and "john" (in separate cells)?

View 2 Replies View Related

Deleting Extra Columns

Aug 14, 2008

I have an excel spreadsheet with Extra columns that have no data in them. I want to delete this columns so that there is no horizontal scroll, but highlighting and right-clicking and choosing delete isn't working. Not sure why. How can I delete?

View 2 Replies View Related

Code To Remove Extra Spaces From Data.

Mar 22, 2007

I have a macro which opens one excel file, then copies the data into another, dead easy. However the first file is 'downloaded' from a bespoke package, where (for whatever reason) the package appends a number of spaces (" ") after data in one of the columns,

So sometimes the data will contain one, ten or more extra spaces (no telling how many) ie, it could look like "AB ", "AB ", or "AB " etc

Ideally What i need is a small bit of code that once the data has been imported to my sheet it can run and 'strip' extra spaces from the column, lets say column f, to leave all the data in this column to look like:

"AB"
"AF"
"CD1"
"VFE"

I am drawing a blank, any simple lines of code?

View 9 Replies View Related

Delete Thousands Of Extra Columns

Dec 4, 2012

My production spreadsheet has thousands of unwanted columns and I am unsure as to how they appeared. I want to delete them. I have tried selecting all of them and deleting them, but nothing happens. I have tried go to > blanks, but it freezes because there are so many columns.

Also, I tried to copy paste to a new sheet, but the formulas get messed up.

For a mental picture, the spreadsheet is approx 225 rows by 25 columns.

View 14 Replies View Related

Code Change Didn't Keep Formatting Of Extra Column

Jun 1, 2014

I changed the code below to add an extra column(E) this worked. However it does not keep the formatting from the top row in column E, How can i change the code to column E to keep the top row formatting ??

Also i added a list to cell A2, but this moves down, I would like to have the selected data move down but the list stays in cell A2, Was this possible ?

View 4 Replies View Related

Assign Values To The Grades And Insert Extra Columns To Do The Calculations

Feb 28, 2010

I have a list of grades they are 3a, 3b, 3c, 4a, 4b, 4c, etc up to 7a. An a is one grade than a b, and a b is one grade higher than a c. In one test a student may score a 4b and in another a 4a. I need a way to calculate the difference in "grades" e.g if a student scores a 4a in test 1 and a 5c in test 2 the difference is 1.

Is there a way I can do this using custom formatting or will I have to assign values to the grades and insert extra columns to do the calculations. I need the simpliest way as I have to disseminate to my staff in my department.

View 9 Replies View Related

Formula To Handle 5 Fields Of Data To Avoid Creating Extra Columns?

Nov 27, 2009

I am inputting 5 variables in columns A through E:

Family (Y/N)
Adult (1/0)
Child (1/0)
Date of Birth
Gender

I am attempting to generate:

Age Males in families sorted into age brackets
Age Females in families sorted into age brackets
Age Males single sorted into age brackets
Age Females single sorted into age brackets

I did this rather simplistically generating 4 columns (F through I) and then using COUNTIF (although I know there is a better way than the lame way I used COUNTIF but that is not the point right now).

However, my question is, can I generate the data described above (located in D13:I22 on my spreadsheet) without going through the messy, cumbersome step of creating extra columns?

View 6 Replies View Related

Hide Columns & Hide X-axis Labels

Nov 22, 2006

I am filtering the data displayed in a chart by hiding columns. I would also like to filter the X-Axis labels by hiding columns. If I do this manually I have no problems but when I run the following macro the chart gives a reference error for the X-axis labels.

Sub ShowA2()
Application. ScreenUpdating = False
num = Sheets.Count
Sheets("X-Axis").Activate
Range(Columns(1), Columns(256)).Select
Selection.EntireColumn.Hidden = False
For a = 1 To 5
Sheets(num - a).Activate
If ActiveSheet.Name = "A2 Data" Then
Columns("A:Q").Select
Range("A10").Activate
Selection.EntireColumn.Hidden = False
Sheets("X-Axis").Activate
Columns("A:E").Select......................

View 3 Replies View Related

Move And Sort With One Column But Insert Extra Columns As Needed For Proper Sort?

Jan 13, 2014

Using DataEntry sheet for data.
Trying to rearrange the data to DataFormatedProperly sheet.
So far all I can accomplish is DataFormatedWrong sheet.

Edit: Not sure what happened but file was NOT understandable before. It should be correct now.

View 2 Replies View Related

Hide The Code

Jan 27, 2009

I know this has been kicked around for a long time, but does anyone know of a way where the user cannot see or change the code. Either would be acceptable, but I would prefer where the user can not see the code.

View 2 Replies View Related

VBA Code To Hide A Row

Dec 22, 2007

i want to know is there anyway we can hide a row if the value of a particular cell is 0 ?

Like if a1 = 0 then Row A should be hidden?

View 9 Replies View Related

Code TO HIDE Or UNHIDE Row

Jul 24, 2007

I am using the code below on my spreadsheet. What is does is hides Row #1 until Row 41 is reached. When 41 is reached Row 1 appears. Unfortunately (for me) I need to alter this code and was wondering if anyone could tell me if it is possible. First the
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Rows(1).Hidden (Target.Row < 41) Then
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Rows(1).Hidden = Target.Row < 41
ActiveSheet.Protect
Application.ScreenUpdating = True
End If

End Sub

What I would now like to happen is that Row 1 stays hidden UNTIL Row 16 is OFF Screen. Can that be done? What has happened is that my row 16 contains the heads for my input table. I have now had to set the rows to resize to accommodate data input. If no rows are resized then Row 16 stays visible until I reach row 40. When row 41 is reached then Row 1 appears which contains my headers as well. I hope this makes sense to someone...

SO, IF I can get a code that would keep row one hidden until Row 16 is off screen then it will not matter what rows expand.

View 9 Replies View Related

Hide Various Columns

Jan 11, 2010

I have a very large spreadsheet that I work in and then print from. When I print, I need to hide about 20 columns which I do manually. I am curious if there is a way I can do this easier. If I could somehow filter columns, or set mutliple columns to a name for a dopr dowm box, or possibly a macro.

View 9 Replies View Related

Hide Columns

Feb 1, 2007

I am trying to use an IF formula to do the following for each row in a large spreadsheet: If the value in column W = 0, show columns A,B,C and E. I have one formula I've used that doesn't work, but as posting what I think is the correct answer could get my post deleted, I won't put it here.

View 3 Replies View Related

Hide Columns Where Row X Has Zero

Sep 12, 2007

I have found vba to hide rows that contain zero values, but not columns.

View 6 Replies View Related

Code To Hide/Unhide CommandButtons

Oct 21, 2008

I have a file which contains many worksheets with many buttons on them for doing administrative work when updating data. I want to be able to click on a button on my "admin" worksheet to hide all the other buttons on the other worksheets. This is hide the buttons from the view of 'readers' so that they will not be tempted to click on a button to see what it might do. I have tried several different variation of coding, but can not seem to get the "right" object to work with so as to set the code to be xxxx.visible=false. I seen references to Shapes, Shape, Control Toolbox buttons objects, CommandButton, etc.

I would really appreciate if someone could give some pointers on how to designate in VB code, which will lend itself of future updates, the following:

in a toogle button, loop through the series of worksheets making each command button on that sheet set visible = false. Then for the other portion of the toogle repeat the process, but set visible = true.

View 6 Replies View Related

Excel VBA Code / Hide Formulas

Jan 6, 2012

I am new to programming in excel. For example user enters the value 1 in A1 and 2 in B2 The answer should be in 3 in C1. How to write this code ? Also is there any way where i can let the user copy the VALUE from the result (C1) into another Sheet in case if am using + Sign to obtain the result in C1 instead of writing a VBA Code.

Basically i am looking for the user to in put data in A and B and the result should come in C like wise i want the user to input the values in few rows and the user should get the result in the respetive rows under column C. The user should copy the values from C into another work sheet/ work book. The user should not have access to the formula but should be able to input values and copy the result. can i do this without vba code if so how ?

View 2 Replies View Related

Code To Hide 6 Listbox In Sheet 2

Jul 31, 2013

I need a code to hide and unhide 6 Active=X Listboxes on sheet 2.

I need to link this to a Active=X Commandbutton.Can the commandbutton caption say hide/Unhide listboxes when selected.

View 3 Replies View Related

A Code That Hide Rows Conditionally

Aug 4, 2007

The below sheet sometimes returns blank (“”) cells in columns C:F. I’m looking for a code that hides the rows 113: to 117 when column C:F (all of them) are empty (“”) for that row. In the above example rows 115:117 should be hidden....

View 9 Replies View Related

Code To Hide All Rows Not Containing Keyword

Jul 7, 2009

I have a sheet with 3 ranges of data in Sheet4, being partcode (B20:B20000), description (C20:C20000) and price (D20:D20000).

What I'd like is a macro to take a keyword entered in Sheet4!C17, search the whole range (B20:D20000), and hide the rows that don't contain the keyword.

Autofilter would be the logical method to my way of thinking, but can that work with a keyword entered in a cell, and can it all be hidden in a macro behind a control button?

View 9 Replies View Related

Hide / Protect Worksheet Code

Jul 9, 2007

I need to be able to save a copy of my spreadsheet but protect the structure so that the hidden rows cannot be opened by the person that I e-mail it to. At the moment I am using the current

Private Sub CommandButton2_Click()
Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
ActiveWorkbook.SaveAs Filename:=fName
Call ProtectRobin
End Sub
Private Sub ProtectRobin()
ActiveWorkbook.Protect ("Robin")
End Sub

The saving part of the macro is working perfectly, however I cannot get the protection to work. It must have a password - I do not want the receipient to be able to go 'Tools' > 'Unprotect Sheet'.

View 6 Replies View Related

Hide/Unhide The Columns

Jun 16, 2009

I've come across a spreadsheet where certain rows and columns (typically top rows or left columns) are hidden; however, there's no way to unhide them (the unhide function is grayed out) and it doesn't seem to be protected or no visible macros/vba on the file.

View 3 Replies View Related

Hide/Unhide Columns

Dec 19, 2008

I have a spreadsheet that has 28 columns for time entries. Typically only the first 12 columns are used, so I would like to hide the remaining 16 columns (which makes the spreadsheet much more user-friendly). It would probably be nearly impossible to teach all of them how to Unhide the remaining columns (and re-Hide), plus I would like to use the full-screen function when employees enter thier times. I would like to use a form control in the column heading so that when the employees 'check' it, it will Unhide and then re-Hide the columns. Any way to do this? Seems like a VB thing to me (out of my league, but would be happy to add one in!).

View 2 Replies View Related

Hide Columns Via A Macro ...

Jun 11, 2009

I have created this macro (below) in a standalone spreadsheet and the expected results are that Columns A,B,C,D,G,H will be displayed after I run the macro.

But when I use the same macro in my production worksheet (columns and ranges adjusted accordingly) this macro creates the following results: Column A is displayed and all the rest are hidden (B,C,D,E,F,G,H). I am stumped as to why this occurs. Can you advice me as to how to get this macro to work and display A,B,C,D,G,H ?

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved