Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Excel


Advertisements:










Macro To Hide The Columns That Contains Date < Today


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 Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Hide Rows If Date Less Than Today
I wish to be able to hide rows if the date value in column B is less than "TODAY" i.e. hide old data.

I have tried the following code but it doesn't work: ...

View Replies!   View Related
Macro To Alert If Today's Date Is Within 5 Days Of Expected Delivery Date
I have a worksheet that has a sent date and expected delivery date I need create a macro that will alert me if today's date is within 5 days of expected delivery date.

View Replies!   View Related
Macro To Test If A Date Is Earlier Than Today's Date
I'm trying to use the Function Today() in my macro to test if a date is earlier than today's date, and I get a compile error.

View Replies!   View Related
Macro For Doing A Date Stamp That Isn't Today
Hi All, I want to set up a macro that will input a date stamp for the working day before this one. I have to input the status of dozens of meeting rooms everyday and the checksheets that I work from are from the previous working day (So on a Monday, I want the Macro to enter Friday's date). I wanted to create a quick macro to save myself the hassle of entering the date for every entry and obviously, if I incorporate the TODAY() function it will update every time I open the workbook and give me the wrong date.

I've been checking related threads and can't seem to find either a VB code or a function that'll enable me to do this (I haven't looked particularly hard as I'm at work ).

View Replies!   View Related
Macro To Rename A Worksheet To Numbers As Of [+today's Date]
I'd like a macro to rename a worksheet from its current name of "FullScreen (2)" to say Numbers, plus today's date (without the plus) For example... Numbers as of 02-17-09

View Replies!   View Related
Import Web Data Macro Using Today's Date In Url
I have recorded a macro to import web data, from a sporting site,
problem is URL is date and event specific.

View Replies!   View Related
Hide Columns By Date
I have a spreadsheet that is updated monthly. THe spreadsheet has a column for each month of the year, plus other columns. I would only like to display the current month and all past months - with the future months being hid from view. SO each time the user opened the file all headers with future dates will be hidden from view. I only would like to see the past months and other other no date column information. Is this possible to do in excel?

View Replies!   View Related
Macro To File/Save As &quot;Numbers As Of [today's Date]; On Desktop
I'd like a macro to have the workbook save as

Numbers as of "today's Date"

and then close that workbook.

I already tried the following...

View Replies!   View Related
Hide/Unhide Columns By Date Range
I have a spreadsheet with a number of sheets two of which contain tables with many columns with a date heading, I would like a means for the user to select a range of dates and for the spreadsheet to automatically hide any columns that don't fall within this range.

View Replies!   View Related
Unhide/hide Multiple Columns Based On Date
I need to show hidden columns based on the date I entered. For example, if I entered "1/1/1990" on a1 as the starting date and "4/30/1990" on b1 as the ending date. I want Excel to show the columns that are covered by the date, thus it shows Jan, Feb, March and April. How do I do that? Here's an example attachment. In here Sheet 1 is the starting point, the highlighted cells is where I enter the date. the Result sheet shows what I want Excel to show me when I have a date entered.

View Replies!   View Related
Sort Table In Date Order But With The Date Nearest To Today's Date At The Top
I have data going in to a small table which has some empty rows as that data is not yet available... My problem is, I need to sort this table in date order but with the date nearest to today's date at the top...

The sort function puts oldest at the top or oldest at the bottom which is no good for what I need...

I use xl 2003.

View Replies!   View Related
Hide Columns Via A Macro ...
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 Replies!   View Related
Macro To Hide Rows And Columns
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 Replies!   View Related
Hide Or Unhide Columns With One Macro
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 Replies!   View Related
Macro To Hide Columns In 2007
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 Replies!   View Related
Hide/Unhide Columns With Macro
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 Replies!   View Related
Limit Of Time Your Can Hide Columns In A Macro
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 Replies!   View Related
Hide & Show Columns Macro
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 Replies!   View Related
Macro To Hide & Unhide Certain Columns
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 Replies!   View Related
Hide Rows In VBA Macro By Checking 2 Columns
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 Replies!   View Related
Calculate The Number Of Days From A Date Entered Into Cell A1 To Today's Date
I need a formula that will calculate the number of days from a date entered into cell A1 to today's date. Whether it's before or after todays date. Example:

5/10/2009 to today is -9

5/22/2009 to today is 3

View Replies!   View Related
Date Countdown: Results Of The Number Of Days Between Today And A Future Date
I am trying to get the results of the number of days between today and a future date. I am using ="cell containing futuredate"-today() and it gets me the correct number of days. The problem comes in when I have yet to populate the future dates. I am getting -39991 (numeric value between today and jan 01 01) and because I am also using conditional formatting this is even more of a problem. Is there a way get excel to display nothing if it is a negative number? or to give a specified resut if the number becomes negative such as Expired or something of that nature?

View Replies!   View Related
VBA Comparing Date In Cell To Today's Date
I need to VBA code that will loop through the active sheet for all rows, column C2 through however many rows there are. Col C contains a date in the format: mm/dd/yyyy. I need the VBA to compare this date to today's date+30 days and if the date in C2, etc. is greater than today's date + 30 days, shade the row a particular background color (e.g., 3).


View Replies!   View Related
Automatic The Date To Today's Date When You Open The File
how can you automatic the date to today's date when you open the excel file?

ie.

Price Report For 02/25/09

View Replies!   View Related
Check Date Cell Is Today's Date
How to check cell from a " DATE" column has todays date or not?

View Replies!   View Related
Highlight A Cell If The Date In It Is Before Today's Date
how I can create a formula that would highlight the cell in a colour if the date was past todays date? This is what I'm doing - I have the expiry date of people's insurances. so e.g todays date is 8 th January, so if the insurance had expired 31.12.08, i would want the cell to be highlighted red. I think it may be an IF function but I cant remember.

View Replies!   View Related
Compare Any Date To Today's Date In Code
With the expiry date as currently set, the code should show the second message box but it shows the first instead.

Sub datechange()

Dim expiry As Date
Dim now As Date

'This line sets the expiry date as 1/5/2006
expiry = DateSerial(2006, 5, 1)

If now < expiry Then
MsgBox "Your subscription will expire in May 2007"

Else
MsgBox "Your subscription has expired"

End If
End Sub

View Replies!   View Related
VBA Macro To Filter Rows By Cell Value & Hide Blank Columns
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 Replies!   View Related
Get The Date Filtered From A Fixed Date Until Today()
Im trying to get the date filtered from a fixed date until Today(), but Im struggling to incorp it into the vba code....

View Replies!   View Related
Hide Columns & Hide X-axis Labels
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 Replies!   View Related
Next Date After Today()
What I'm trying to accomplish:

In A1:
If a date in H2:H10 is greater than TODAY(), return the value of that date.

If TODAY() happens to be 1/20 and H2:H10 looks like this:

1/5/09
1/6/09
1/13/09
1/14/09
1/19/09
1/15/09
1/22/09
1/27/09
1/8/09
1/28/09


than A1 should have the value of 1/22/09
When TODAY() = 1/28/09, A1 should have no value, preferably no error either, but I can live with a NUM! or Value! or #N/A

Dates will not always be ascending. All cells in H2:H10 may not be filled. There may possibly be a duplicate, but the fact that there is a duplicate is not important to my result. (I'm looking for the 'next scheduled working day' whatever it is)

View Replies!   View Related
Get Next Date After Today()
In cell K25 I have a value where if it is greater than 49 I want the forumla to look at the values of Cells L3:L22 (these cells have a range of dates in them). I want the formula to go through these cells and pick the next date after today....If the value in Cell K25 is Less than or equal to 49 I want it to just return Todays date.

I found this post http://www.excelforum.com/excel-gene...ter-today.html which was basically what I was looking for, but for some reason when I put that into my formula it will return the smallest date, even if it is older than today.

So going back to my formula....Here is what I have currently in my cell:
=IF(K25>49,MIN(IF(L3:L22>TODAY(),L3:L22)),TODAY())

Like I mentioned above - this results with dates that are older than today - what can I do to make it return results that are only after todays date?

View Replies!   View Related
SUMIF DATE=<TODAY
Just getting into Excel and lookups want to SUM a 'Profit' colum if the date colum is less than TODAY - I basically have a set of data - 1 sheet per year where the dates are displayed dd/mm I want to achieve the SUM of the Profit Colum if the date is less than or equal to todays date (dd/mm only) for the year so we can compare year on year.


View Replies!   View Related
Yes Or Know If Date Over One Year From Today
I need to flag a cell red if the date in it is greater than one year past today. Then I need to to get a percentage of yes vs. no at the bottom.


View Replies!   View Related
Lock-in TODAY Date
Is there any way to automatically lock in the date after you pull it up with the TODAY function? Or is there another function that will do what I'm trying to do?

I want it to automatically fill in today's date, when a certain empty cell has a value put in, then freeze there.

View Replies!   View Related
=today()+1 To Add Date
I am use the following formula =today()+1 to add date and what i would like to do is whne i save the work sheet under and new name is to have the date turn to a valve can this happen ...

View Replies!   View Related
Date Validation Should Not Be > Today()
I have string in sheet source which has date part, that date part should not be >today(). When I extract date from source sheet to destination sheet, if the date part has the date >today() it should not load into destination sheet.

Source sheet data ...

View Replies!   View Related
Using Today's Date In A Formula
this is my first post and i was a little unsure as to whether to put this in the General or VB/Macros forum, because it kind of involves both.

i'm trying to write a macro that inserts a formula that uses the date of the day that it was run (that is, i don't want it to be volatile like TODAY() and NOW(), but i don't want to have to manually type in the date into each formula).

is there a way that i can write a formula that uses the date of the day it is entered into the cell, or write a macro that adds today's date (perhaps using ActiveCell.Value = Date) and then writes a formula around that?

View Replies!   View Related
Go To Today's Date Column
I have columns labeled with various dates.

How can I have excel go to the column with todays date when the sheet is opened?

View Replies!   View Related
Code For Accept Today Date
code which will allow me to update only todays date in particular cell in that cooumn and once the date has been entered it will save as value so that next day it will not change the date.


View Replies!   View Related
Conditions Based On Today Date.
I'm using 2007 but I need this to work with Older versions so I tried to combine the condition for red

View Replies!   View Related
Lock Range If Date < Today
I need to lock cells in protected and shared workbook if cell value in colA is 2 days less than today

Eg. if A5=today()-2 then it should lock range A5:I5

View Replies!   View Related
Countif (?) Within A 2 Week Date Range Of Today
I have a workbook which contains 1 spreadsheet that contains data entry for approximately 20 employees. The workbook then contains a separate sheet for each employee to display the detailed information

Column A stores the dates from Jan1 to Dec 31
Row 1 contains the employees names.
The data entered consists of approximatle 4 different 1-letter codes as to what transaction occurred that particular day.

What I would like to do now is be able to count the number of cells that contain a code for 2 different time periods. I would like for it to count 2 weeks ago and separately count 2 weeks in the future.

In trying to get this last calculation, I've added a column for WEEKNUM next to the date (column B) and used somethign along the lines of
=CountIF(C2:c366,Weeknum(Now()-2)) and also tried +2. Neither have worked.

View Replies!   View Related
Check If Each Cell Has A Date Greater Than TODAY
I've got the following function that check if each cell has a date greater than TODAY(). If result is true, it'll display "NO GO". Otherwise, it'll display "GO".

I would want to improve on it such that if any of the 'B5:F5' cell is empty, it'll display "Incomplete" instead of "No Go".

View Replies!   View Related
Array Formula - The Earliest Date After Today
I tried searching through the forums, but I don't exactly know how to word my question!

I have a workbook with two sheets: Meetings and MasterStatus

On the both sheets I have taskID for a specific task.

On the MasterStatus sheet, I want to use an array to look up the next meeting date for each taskID (Column C), referencing the Meetings sheet (Column E) to do so.

The formula I have so far doesn't work:

=MIN(
IF(
AND(
Meetings!$A$2:$A$3000>TODAY()-1,
NOT(ISBLANK(Meetings!$A$2:$A$3000)),
Meetings!$E$2:$E$3000=$C$7),
Meetings!$A$2:$A$3000,
0
)
)

View Replies!   View Related
On Today()+1 Increase Date In Cell By 1 Month
I have 22-08-08 in Cell A2 I would like it to change to 22-09-08 on 23-08-08 ideally using edate (but not neccessarily).

Perhaps I can add a formula with conditional formatting eg formula is = "On Today()+1 Add 1 month to cell A2"

View Replies!   View Related
Naming A Worksheet With Today's Date
How can this be done using VB? The format of the date I'm looking for is: 16-Nov-08

View Replies!   View Related
Color Cell Containing Today's Date
Upon opening a spreadsheet, I would like a macro to highlight the cell which contains todays date. This will be selected from a range of dates which are already populated in column B. Is it possible to have a macro which can select the cell in column B which contains today's date? If possible, please could you include the code for doing this upon opening the spreadsheet. I'm not too confident about that either!

View Replies!   View Related
Using VLOOKUP To Display Date If Present, If Not Display Today's Date
I'm currently using an IFERROR, VLOOKUP formula to display an availability date for a product.

Atm, it reads some like this

View Replies!   View Related
TODAY() Function And Viewing Or Printing Original Date
I have a seemingly simple dilemna and wonder if there is a solution... I am not a PRO user, but can get by with my limited knowledge of excel.

My issue:

I create invoices for my business and in the invoice I use the "TODAY()" function to automatically insert the current day when I created the invoice.

Now when I need to go back and look at the old invoice or print it again it shows the CURRENT date, not the original date when it was saved. Is there a way to view and/or print out a file while keeping the original date intact or is there a better way to format a date to avoid this happening in the future.

I have since eliminated the function and just type in the date to avoid this but I have about 100 invoices that are saved that I may need to view their "original" dates on.

View Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved