Macro To Hide Columns In 2007
Jun 10, 2009
I have written a macro to hide any column (within a range of columns) that has an 'x' in it. By putting the 'x' in the column, it allows the allows the user to choose what columns they want to hide. I have an inverse macro as well that unhides those hidden columns.
These macros work perfectly in Excel 2003, but they do not work in Excel 2007. In Excel 2007 I get a compile error: can't find project or library. As a note, all other macros in my spreadsheet (Module 1) work.
View 2 Replies
ADVERTISEMENT
Mar 18, 2014
I currently have the following Macro for one of my many checkboxes in 2007 Excel:
[Code] .....
It works perfectly until additional rows are added/deleted before the indicated rows in the code (It changes the number sequence in the workbook). The number sequence stays the same in the code which means I am now hiding rows either before (delete rows) or after (insert rows) the intended rows I want to be hidden. Is there a way to change the above code to remain with the assigned rows regardless of the adding/deleting of rows before it?
View 1 Replies
View Related
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
Nov 21, 2008
I have a single button I want to use to call a macro to:
1.Hide columns C:AZ if they arent already hidden
2.Unhide columns C:AZ if they are already hidden.
View 2 Replies
View Related
Nov 27, 2012
I want to set up a macro that will hide and unhide columns.
View 9 Replies
View Related
Aug 1, 2008
The macro code that will populate and input box and ask you which range of columns and range of rows you wish to hide, hide the columns and advise you via a message box that it has been completed
View 9 Replies
View Related
Sep 19, 2008
I'd like a macro that can hide/unhide certain columns. At the moment, the columns I want to hide/unhide are F, I, M, P, U and Y.
View 4 Replies
View Related
Sep 3, 2007
I need hide/show some column by using Macro Button. I have attached the excel sheet( name VBA testing.xls). I need to hide column K,L,N,O & visible column G,H by clicking button "Plan A".Similarly i need to hide the column G,H,N,O & unhide the column K,L by clicking the button "Plant 2. Similarly by clicking the Button "Plant 3", hiding the column G,H,K,L are needed whereas column N,O will be unhide.
View 7 Replies
View Related
Dec 15, 2007
I have a simple macro that I have been using to hide columns in a very large spreadsheet. Essentially, the user has access to buttons that allow him to choose between a variety of the most commonly used views. For some reason, when I add columns and adjust the code to hide/reveal these columns, I get:
"Run-time error '1004' - Unable to set the Hidden property of the range class"
with the Debugger highlighting the code for "BO:DC". This problem occurs for several of the similar buttons, including toggle buttons, that hide/reveal columns. I am aware that custom views can be created in the drop-down menu, but I wanted to keep these buttons on the sheet as a quick means of moving from view to view and toggling columns between hidden and revealed.
Private Sub CBMonographMLA_Click() ...
View 3 Replies
View Related
Jan 29, 2010
My spread sheet is a church offering register that is used to record weekly contributions. Column A contains the names of the individual contributors. Columns B through BA are used to record the weekly contributions for each of the 52 weeks of the year. Row 1 of columns B through BA contains the Sunday date MM/DD/YYYY.
I would like to have a macro that would scan those cells looking for a date < today. If that condition is true, I would like to hide that column. When date = today or date > today the macro can end. The goal is to have display the current week's column immediately following Column A.
View 4 Replies
View Related
Nov 28, 2012
Need a macro for each button.
The sheet will be protected with a password (in the future, users will have varied access privileges).
Column A is designated as the "Button" Column.
There are 5 buttons here. Each representing the area on the sheet that needs to be viewed. Once the button is pressed, it takes you to that section of the sheet. At this time, I have designated each column area as:
a-z
aa-az
ba-bz
ca-cz
da-dz
I have tried this formula with opening tabs, but this won't work.
View 5 Replies
View Related
Aug 1, 2007
I often have macros that hide columns. Seems there is a limit to the number of time or columns that can be hidden before you get a debug. Message.
View 9 Replies
View Related
Oct 8, 2009
I've tried using multiple loops in the forum but cannot seem to figure out how to actually get them to work properly using the conditional VBA codes on two separate worksheets. The first code snippet is checking cell values from row 6 to 148 as such:
Sub Check_Shifts()
'Insure all shift entries are completed
If Range("K6").Value < "1" And Range("I6").Value < "1" And Range("G6").Value < "1" Then
Range("G6").Value = Range("F6").Value
Range("I6").Value = Range("F6").Value
Range("K6").Value = Range("F6").Value
ElseIf Range("K6").Value < "1" And Range("I6").Value < "1" Then
Range("I6").Value = Range("G6").Value
Range("K6").Value = Range("G6").Value
ElseIf Range("K6").Value < "1" Then
Range("K6").Value = Range("I6").Value
End If
If Range("K7").Value < "1" And Range("I7").Value < "1" And Range("G7").Value < "1" Then........................
View 7 Replies
View Related
Dec 7, 2011
I want to hide and unhide columns based on a cell's value.
If D6 of the ‘Summary’ Worksheet Is <> to ‘Test1’ and <> ‘Test2’
THEN Hide columns D:K of the ‘Charts – Source Data’ Worksheet
OTHERWISE Unhide columns D:K
View 4 Replies
View Related
Jan 10, 2012
I'm trying to record a macro which will hide and unhide columns K:P of data, but I only want one button. I know how to do this to produce one button for hiding and another for unhiding...but I want one combined button.
How to use vba, how I do this via the macro recorder?
View 9 Replies
View Related
Nov 4, 2013
I have a workbook with several sheets that have basically the same template but some have many more rows that others..
I am using the following code to hide columns based on cell value to "tidy it up" for printing.
Code:
Dim i As Long
For i = 170 To 2 Step -1
Cells(39, i).EntireColumn.Hidden = Cells(39, i).Value = "N"
Next i
I would like the VBA to determine what the row number is based on the row header e.g. "Prioritised Courses", rather than having to maintain the code each time new rows are added.
I would put it at the top or way down the bottom, but multiple (even less excel skilled) users will be using the "hide columns" functionality.
View 6 Replies
View Related
Oct 1, 2008
i have created a spreadsheet to simplify our work flow, I am stuck on what is probably the easiest of the commands.
basically have rows dedicated to specific codes and the colums represent values relating to each code, all codes have a different set of values, the attached example only has a few variables but the actual worksheet will have several hundred.
the idea is the user will input the code they wish to get details on in A2 and then press the command button and it will then show (as per the after sheet in the attachment) just the relevant information for that code, so filter the code in column A and hide the columns which hold no value.
where i am getting stuck is I am not sure the best way to proceed, is it best to create the macro button to do the filter and hide or is there a better way using vlookup and a pop up window asking for the relevantcode to be inputted to to retrive the information, again understand there will be hundreds of colums and hundreds of rows and the values may be 20 or 30 colums apart for some of the Codes so this simplification is really saving the user a lot of time.
View 7 Replies
View Related
May 30, 2012
I have a file with 2 columns (A=headers, B=values x 38K rows) and need to transpose them to rows.
I found code to transpose a specified number of rows in a column (i.e. every 5th row in the column)...
BUT my columns have variable numbers of data points, because in the exported file any head with a null value was excluded.
So I need to start new rows with a specific text value of "Username" occurs in column A.
View 2 Replies
View Related
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
Jan 18, 2013
I created a workbook called "controlelijst.xls" using Excell 2007. In this workbook i created a sheet that i use as a template, it has conditional formatting all over it. That in fact is not the problem. I copy this template for every new issue i have.
The thing i would like to see happening now is when i enter the value "Y" in cell O10 that the active sheet on wich the value is entered becomes hidden. Because the reason for setting this value is that all conditions are met on this sheet and it does not have to be visible anymore unless i unhide it.
View 3 Replies
View Related
May 4, 2013
I would like to take the data from worksheet1 and put into worksheet2 but limit the length of a list (the real spread sheet has over 100 rows and i would like them in 4 sets of 25 versus the example I provided). Is there an array or macro that would make this work (keeping the formatting)..
Excel 2007
B
C
3
Name
Company
[Code].....
View 9 Replies
View Related
Jul 31, 2009
I see this forum and the example works perfectly in Excel 2003.. But we are using Excel 2007 now and it doesn't appear to be recognizing the user and is always refering to the "else" in the vb codes. Does this code for not work in 2007? Oh and I am refering to Post #10 on there with the attachment that will hide different sheets depending on which user is getting on the file.
View 3 Replies
View Related
Jan 1, 2012
In excel 2007, when I do workbook_Activate I want to hide all of the command bars. in 2003 vesion I used
.CommandBars("Worksheet Menu Bar").Enabled = False
But it is not working for me on 2007.
View 4 Replies
View Related
Dec 27, 2012
Code:
A
B
C
D
2
34
If I had columns as above with values in B1 and C1 but none in A1 and D1
How do I loop through so that columns A and D are hidden?
My spreadsheet has columns A to DI and different columns have values each day so I want to write code to hide just the columns with no values.
View 6 Replies
View Related
Jul 1, 2007
I am not sure I like Excel 2007 yet, I have been playing around with it all day and while it has some good features, it is hard to fathom in places. I expect it is just a matter of time to get used to it.
With previous versions of Excel, hiding and un-hiding commandbard and toolbars can be achieved in a number of ways, such as with the code below
ActiveWindow.DisplayHeadings = False
Application.DisplayFormulaBar = False
Dim cbar As CommandBar
For Each cbar In CommandBars
If cbar.Enabled And cbar.Type = msoBarTypeNormal Then
cbar.Visible = False
End If
Next cbar
CommandBars("Worksheet Menu Bar").Enabled = False
This does not work in Excel 2007, I have tried many methods but all seem to be redundant in 2007 -
View 6 Replies
View Related
May 13, 2014
Using Excel 2007, I have a workbook with 7 sheets. The first one is a Navigation Page where I have checkboxes (form controls, not active X) with the names of the other 6 sheets. When the box(es) are checked, the sheet(s) become visible. I have accomplished this by assigning macros I recorded.
I need to now add the opposite: When the box(es) are unchecked, the sheets become hidden. From googling and looking for other threads/forums here, I gather that I need to add code/ VBA, but I know nothing about these at all.
View 2 Replies
View Related
Jun 26, 2012
I have an intern that is working with me, and I have a file that I need updated but one of the columns has confidential information so I would like to just hide & password protect this column this way he can't access/view this information but still have access to modify the rest of the spreadsheet.
Is there a way to do this in Excel 2007?
View 3 Replies
View Related
Jun 17, 2013
Excel 2007.
I created an excel Calendar that has columns for months and weeks, and rows for hours of the day.
I have two drop lists one contains months, and one contains weeks.
Basically if you choose august from the first drop down list, all the rest of the columns that are not August disappear, and the sheet only shows august.
The second dropdown selects the week. If you choose week 1, it shows week 1 of this particular month. This second drop down is what I do not know how to make work.
This is the VBA code i used.
Private Sub ComboBox2_Change()
Select Case ComboBox2.Text
Case "May"
Range("All").EntireColumn.Hidden = True
Range("May").EntireColumn.Hidden = False
[Code] ......
I do not know how to make the code or choose the categories so that It only shows the week of the month chosen in the first column. Will I have to name each and every group of columns for each and every month as May - Week 1, May - Week 2...... June - Week 1, June - Week 2, etc... or is this a way around it?
View 7 Replies
View Related
Nov 1, 2009
I have an Excel 2007 workbook which has five sheets in. I just wondered whether it is possible to hide all five of them when the workbook is first opened. Also I would like the user to be asked for a password when they wish to unhide a sheet, with the password being different for each of the sheets.
Is there also a way to do this which won't be affected by Excel disabling all Macros when the application initially opens.
View 6 Replies
View Related
Oct 6, 2013
In excel 2007, I have an embedded image on a sheet which I want to make it hidden by default. When someone hovers over a particular cell say cell B3, then image should be displayed below this cell (sort of hyperlinking) and when the cursor or activell cell is not in B3 it should be hidden again. What steps/technique/VBA code will make it happen ?
View 3 Replies
View Related