Date Autofill From Input Box
Apr 2, 2013
So, the macro I'm working on is working great, except for the date autofill.
The macro has an inputbox that requests the date of report from the user. This is manually entered into a textbox. Instead of filling the same date to the last used row, it goes up in incriments of years. IE: (A1) 04/01/2013, (A2) 04/01/2014, (A3) 04/01/2015, etc.
I was thinking a Copy/Paste to the last row would work, but I can't figure out how to do that. ("DateOK" is the name of my OK button, and "ReportDate" is the name of the textbox.)
Here's my code:
Private Sub DateOK_Click() Range("A2").Value = ReportDate
Range("A2").AutoFill Destination:=Range("A2:A" & Range("B" & Rows.Count) _
.End(xlUp).Row), Type:=xlFillSeries
Application.CutCopyMode = False
ReportDate = Empty
DateForm.Hide
End Sub
View 7 Replies
ADVERTISEMENT
Mar 2, 2012
I would like to make a button on my toolbar that will let me autofill whatever cell I've selected down to whatever row I designate. I would like to have a user input where you put in the row number and it autofills whatever formula down to that row in the column selected.
I know how to do a normal autofill, but I don't know how to do a user input or have it input into the autofill process.
View 5 Replies
View Related
Jun 16, 2008
i'm trying to do is have a formula that when certain text is typed into column 'b' (fmc, nmcmc, etc... anyways..) when an airplane is 'fmc' its 'green' and i want the aircrafts tail number block in column 'a' to autofill in with a green color, and when its 'nmcmc, i want it to be red. when its 'bq' i want it to autofill in as yellow.
View 10 Replies
View Related
May 26, 2006
I have one column( date) which I wanna set date range from VBA macro. The problem is I wanna use Autofill to fill from the start date to the specific end date, but with Autofill func I cannot do this.
I attached a sample to explain my problem. Please take a look and give me a hint to do this.
View 6 Replies
View Related
Oct 29, 2012
Is there a formula I can use to see what the last time the sheet was saved is without using visual basic
View 1 Replies
View Related
Dec 7, 2013
I have to create a number of spreadsheets with changing dates / times / both.
This would be a fairly good example:
Add one day + 1 hour for 31 days of a month.
"01/01/2014 01:10"
"02/01/2014 02:10"
"03/01/2014 03:10"
"04/01/2014 04:10"
"05/01/2014 05:10"
"06/01/2014 06:10"
"dd/mm/yyyy hh:mm"
The above format is important, and - it has to be in quotes.
Which, if necessary I will manually add using replace, but would prefer not to.
So I may then need to take the first date... lets say 06/12/2013 07:00 then, Add one day + 3 hrs 30 mins.... so as the days roll between 1 to 31 it is obviously going into the 24 hour clock, rolling argument.
And, to top that -
1. the csv then needs to be put into software (I assume it reads the data in the sheet and not the formulas).
2. I can't have extra columns as they would need to be deleted.
I have tried copying down, like a standard auto-fill but it always goes wrong.
View 3 Replies
View Related
Jul 16, 2008
I am making a movie ticket spreadsheet for the employees to use when selling movie tickets. Below are the feilds that I have. Everything is based on the number of tickets sold. So when someone sells 5 tickets I would like the date entered without changing when I update the sheet the day after.
Begin #End #$ Amount# SoldNamePayment AbbreviationDate
Under payment the payment abbreviation we use words like debit, cash, check, etc when selling a ticket. Can you type c in the payment abbreviation field and have it automatically put cash in the same field without using autocorrect?
View 18 Replies
View Related
Sep 11, 2006
I have a column with dates + time under this format: 2005-01-01 00:00:00. I wanted the same thing for the whole year, so, I wrote 2005-01-01 01:00:00. in the cell below, and then did an autofill.
Unfortunately, at some point, the cell goes from
2005-01-05 03:00:00
to
2005-01-05 03:59:59
which is a problem for me, because I was using the hour as an indicator.
And hour(2005-01-05 03:59:59) returns 3 and not 4!
View 6 Replies
View Related
Feb 19, 2014
I have been struggling to find where my code is throwing up an error 1004 on the last line of the below code. I have a number of tables which will update automatically from Pivot tables on another sheet.
So the first part of the code is adding in the new column and then I want to autofill the date into the headers of the column which I thought the below would do, but I just don't understand why I keep getting the error. My data is dynamic as it will grow month by month which is why I am using R1C1 referencing.
Sheets("PNN Table").Cells(9, 16384).Select
ActiveCell.End(xlToLeft).Select
ActiveCell.Offset(0, -2).Select
Selection.AutoFill Destination:=Range(Selection, Selection.Offset(0, 1))
View 3 Replies
View Related
Aug 14, 2012
I have a input box that prompts a user to enter a date of a new month - it has to be the 1st of a new month. I have validation that it is a date that has been entered but then i want to validate the date entered is a month ahead of a date in a cell range on a sheet.
It is a monthly reset so it has to roll on from the previous month.
Here is what i have currently but it isn't working.
Code:
' Get user to input the first day of the new month to populate all dates with
dNewMonth = InputBox(Prompt:="Enter first Day of the new Month. Must be the 1st of the Month e.g. 01/10/2012", _
Title:="Enter Date")
' Validates the entered date is a valid date
If (IsDate(dNewMonth) = False) Then
[Code]...
View 1 Replies
View Related
Mar 5, 2014
based on user date ranges entered on sheet1, I'm trying to write code that will write each month of the date range on other sheets across the 2nd row. at this point I'm getting "object required" error at "Set DateStart = Cells(2, 6)"
I also want the date format to be mmm-yy (Mar 14) on the sheets even if sheet1 has a different format. I tried using sourcerange instead of DateStart, but that didnt work either.
Code:
Dim projStartDate As Date
Dim projEndDate As Date
Dim DateStart As Date[code]....
View 1 Replies
View Related
Mar 24, 2014
I'm using nested SUBSTITUTE formula to make some changes to the some of the data. I'm also using IFERROR to return the input if it does not find the criteria I have specified. I have lot of variations in my input data.
The formula works fine for all except for date format input.
Sample:
N90232Y09--->SUBSTITUTE(A1,"N","")-->90232Y09
12335--->12335
12/3/1923---->58936 (I want the date to be retained)
why the date format is changed even if don't specify any changes for it. I expect my IFERROR to just retain the input as it is.
View 4 Replies
View Related
Sep 20, 2013
I am currently trying to make a digital time card for my place of employment. I has an odd set up and odd date ranges. The pay period starts on the 21st of each month and ends on the 20th of the next month.
The time cards have 5 columns for each week starting on Mondays going to Sunday (also weird its not Saturday to Sunday) What I was hoping to accomplish was being able to select the starting month of your choice for pay period and have multiple cells update the week date range.
Date
Date
Date
Date
Date
**Here would be the drop down month select.
Sept 21 - Sept 22
Sept 23 - Sept 29
Sept 30 - Oct 6
Oct 7 - Oct 13
Oct 14 -Oct 20
View 2 Replies
View Related
Mar 29, 2014
My macro asks for a user input in DD-MM-YY format (which is the same format of all cells in the Excel worksheet).
I then instruct the macro to paste the string into cell A1 in 'TEST' sheet.
However when it pastes in the format is MM-DD-YY with the user input DD being the worksheet MM etc.
For example 06-04-14 becomes 04-06-14.
My code is below:
[Code] ......
Attached File : TEST.xlsm
View 2 Replies
View Related
Jan 18, 2007
I need to compare the date from the user input and the date listed on excel. How can I compare it? Is it correct? lngCmp = Val( Cells(I, 31))
Dim lngBegin As Long, lngEnd As Long, lngCmp As Date, lngResults As Long
lngBegin = 9 'beggining of data
lngEnd = 232 'end of data
lngCmp = InputBox("Please enter the date", "Begining of the week")
Lngcmp1 = DateAdd("d", 1, lngCmp)
lngCmp2 = DateAdd("d", 2, lngCmp)
lngCmp3 = DateAdd("d", 3, lngCmp)
lngCmp4 = DateAdd("d", 4, lngCmp)
lngCmp5 = DateAdd("d", 5, lngCmp)
'lngCmp1 = lngCmp + 1
'lngCmp2 = lngCmp + 2
'lngCmp3 = lngCmp + 3
'lngCmp4 = lngCmp + 4
'lngCmp5 = lngCmp + 5
lngResults = 0
lngResults1 = 0
lngResults2 = 0..................................
View 2 Replies
View Related
Nov 3, 2008
I am running excel 2003. I am creating a book that needs date & time input on every row. I am trying to input this automatically based on adjacent cell being >0. Every time there is a new input, the previous dates / times update to the latest one.
View 5 Replies
View Related
Aug 3, 2007
I need to have users input a date range for a report and then use that to autofilter a query from a database.
I think I have it close, but I can't tell what I'm missing. I can see the InputBox dates if I put them into a cell. And the criteria operators come up correct in the Autofilter, but the value shows as Starting and Ending, so it's filtering out everything.
View 10 Replies
View Related
Dec 16, 2008
I have the below code that when the spreadsheet opens input boxes pop up. The first asking to put the date in, but how can i make sure that the user does not put "todays date" in at anytime! (the date put into the inputbox (cell d2) should always be less than the date in b2 = todays date). As cell b2 in the sheet "97008390" already has todays date in. (using =today()).
View 4 Replies
View Related
Sep 14, 2009
I have a VBA code that works really well but i wondering if there is a way to do the same thing but without the message box and just enter in the dates instead.
View 11 Replies
View Related
Dec 18, 2009
I would like to bring up an input box when a button is pressed containing the text "which number do you want to update".
The user would then enter a number eg 101 and then by clicking ok, todays date (in the format MMM/YY) would be entered into cell J101 in Sheet5.
View 8 Replies
View Related
Apr 7, 2009
i have this concatenate problem from dates... see the attached file. if i copy and paste as special value.. it puts the date values aswell.. i cant seem to put there only numbers.. if i wanted to use concatenate..
View 2 Replies
View Related
Mar 10, 2012
I have an input box that requires the user to enter a date or accept today's date, which is the default, and when they click ok it is entered in cell "Data!D25". I want the format to be "yyyy-mm-dd". I have set the cell "Data!D25" to automatically use this format if I type the date directly into the cell by typing "yyyymmdd" without the dashes but when they type in the input box without the dashes, the result in the "Data!D25" cell is "############".
How can I correct this?
Code:
Sub PrintForms()
' Dim StartRow As Integer
' Dim EndRow As Integer
' Dim Msg As String
' Dim I As Integer
[Code]...
View 9 Replies
View Related
Nov 24, 2006
I would like to enter a date from an input box(which i have entered in the code below), this would then lookup in column F and find all rows and copy them to relevant sheet 7 days from the date entered.
E.g. if 24/11/2006 this would bring back all rows which from the 17/11/2006
Sub FindMe()
Dim intS As Integer
Dim rngC As Range
Dim strToFind As String, FirstAddress As String
Dim wSht As Worksheet
Dim rngSearch As Range
Dim strToFind1 As String
Dim rngC1 As Range
Application.ScreenUpdating = False
intS = 1
Set rngSearch = Worksheets("Template").Range("a3:z20000")
Set wSht = Worksheets("Closed Issues")
strToFind = InputBox("Enter the title to find").................
View 9 Replies
View Related
Feb 1, 2009
I have made a MsgBox which opens on Workbook opening with a message as follows:
View 4 Replies
View Related
Jan 24, 2009
I would like to use Validation to verify that the date entered in cell "B3" is a Sunday. Or do I have to go at this some other way?
View 4 Replies
View Related
May 20, 2014
Any way to limit the date a person can input to the fourth business day of the following month. So limiting the date the 06/05/2014 for instance. Would there be a way to keep this updating so manual updating would be unnecessary?
View 9 Replies
View Related
Jan 20, 2007
I have designed a spreadsheet to calculate time and speed averages of a ships voyage. When using a date and time value entered into a input box the value in the cell is reversed form the U.K date format to the U.S date format. this has been causing great amount of fustration to me. the cell has the correct date format i want and the excel system is configured to the U.K format. my program to allow you to look at it my knowlege is not very good of VBA. When entering the date in the FAOP from the drop down menu as dd/mm/yy hh:mm in is reversed.
View 2 Replies
View Related
Apr 6, 2008
have a range of dates in a column i can match an input date with this code where the input date is in cell H20 (eg 04/04/2008)
With ActiveSheet
Range("D:D").Select
Range("D:D"). Find(What:=Range("H20"), After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End With
the problem is that not all the dates in the range are consecutive and there may be the same date more than once eg
01/04/2008
03/04/2008
03/04/2008
05/04/2008
the problem is if the date in cell H20 (inputted by user) does not exist in column D, it all goes wrong.
what i would like to achieve is a way of incrementing the cell date by one day until it matches a date in the range, in this case if 02/04/2008 was entered 03/04/2008 would be picked up.
View 3 Replies
View Related
Oct 20, 2012
I need to input a future date and time into one cell. For example, if I have a member ship that ends on October 20th at 3:00 pm exactly the kind of format you get when you enter the function "NOW". I would like to put that into one cell and then be able to add and subtract from it.
For example I would like to do something like this, if I had inputed the date and time in A1:
"=Now-A1", it would be cool if I can get the remaining hours or minutes along with how many days are left but not completely needed.
It would also be beneficial if I can drill down further and do it by time zone as well.
View 2 Replies
View Related
Dec 6, 2013
Auto date and time using excel macro.
In cell B2 until Z2 I am inputting data.
Once the data has been inputted in cell B2, I like to have date and time to have in Cell B6.
If input in cell C2 then cell C6 to have date and time..
View 4 Replies
View Related