Macro To Prompt Key In Date?
Jul 21, 2014
excel macros and only know how to record certain tasks, and then edit after recording the task.
I am working on a project to automate a daily routine task for a company which involves creating a new tab and inputting various datas.
How can I create a macro such that I create a new tab and a combobox appears asking me to input the date in a particular cell?
This is the first in a number of steps for fully automating this process.
So far I only have this to create a new tab.
------------------------
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveSheet.Copy After:=ActiveSheet
End Sub
------------------------
View 1 Replies
ADVERTISEMENT
Sep 15, 2014
I have a cell (C16) that has a date format (such as 08/28/2014). I want the value of this cell to be "N/A" when cell C7 is "No". When C7 is "Yes", I want Excel to prompt the user to enter a date for C16 when they click on C16. The formula for cell C7 is =IF(C3="No","No","Yes"). That's where the value of C7="No" comes from. If I didn't need a date for the value of C16, the formula would be something like =IF(C7="No","N/A","______"). I have just recently started trying Excel macros due to a tool
View 9 Replies
View Related
Oct 12, 2009
I have a macro that performs an operation on all Excel files in a given folder. The only problem I had was I couldn't walk away until it was done because the files themselves had macros that gave me a Yes/No prompt to recalculate.
I already have a calculate command in my macro so how can I override this command without physically selecting and clicking "No" with my mouse and without editing the macros that are already in the files (each unique and embedded in the individual worksheets). I cant edit each file because there are close to 300 of them.
View 9 Replies
View Related
May 3, 2007
I need to put together a macro, which will be assigned to a command button, that will prompt the user for a pre-specified password, and, if the password is correct, return a pre-specified value in a different cell. Is there any way to do this?
To put it in perspective, at my company we have approval sheets that need to be signed by several executives that are scattered all over the building. The first executive gets the copy, signs it, sends it off, etc. They tend to dissappear on occasion, so we are looking to make it all electronic, where they can access the file in a shared folder, and the if they enter their password correctly, their initials are input into the specified cell. They can than save the file for the next executive to do the same.
View 5 Replies
View Related
Mar 23, 2014
I have a print button or object and I want to assign a macro to it that when clicked brings up a prompt to type in a Month or Year to Date and prints the data that corresponds to that month or YTD. I have a Date column in a table that I can get a different macro to print by basially having the macro filter by blanks, so essentially printing all the dates in the table, but I feel as if it could be much better and simpler by prompting the macro to filter by "x" Month and print.
View 3 Replies
View Related
Feb 11, 2009
I am trying to complete a toolbar that will lock and unlock all the sheets in a workbook. While I can set the password automatically I'd like to have the macro ask for the password instead of hardcoding it.
Here is the code I currently have and works so long as I have already set the password in the workbook to match what is in the macro
View 3 Replies
View Related
Aug 28, 2009
I have looked in books and online and can't seem to locate how to create a macro that opens a browse function. From Excel I would like to click a button to start a macro and have that macro prompt me where to browse for the file. There is a lot of other code that will go after this step (which I already have), so once I click to "open" a file I want the macro to continue.
View 6 Replies
View Related
Mar 15, 2013
I'm trying to create a macro that I can assign to a clip art pic that will pop up the Insert Hyperlink prompt when I click on the picture. So basically anytime I click on the pic for the 1st time I'd like to be able enter the url address of my choosing but if I were to click on that pic again I want it to go to the Hyperlink address I previously entered.
I should note that I tried recording a macro by first by clicking on Record Macro then press ctrl + k and then click Stop Recording but it wouldn't stop recording. I had to first click Cancel on the Insert Hyperlink prompt and then I was able to Stop Recording so this attempt was unsuccessful.
View 2 Replies
View Related
Sep 4, 2009
I have several hundred workbooks with multiple worksheets(15-35) that I am trying to tidy up, so the data can be entered into a database. Its my first attempt at VBA and between the forum and macro recorder I made an attempt which is below. I just can't seem to get over the last part. I have searched the forum but can't seem to find any relevant information. I have a couple of questions.
1. I need to be able to run this macro over all the worksheets in the workbook, so how can I loop it? All the worksheets are named differently i.e. peoples names.
2. In my code I have inserted 4 columns. These columns will be the only thing common between all the worksheets. A1 to A30 = Week number, B1 to B30 = Shift Number, C1 to C30 = Supervisor number. Column D is blank. I'd like to be able to be prompted to enter these 3 numbers at the start if possible? Can this be done in such a way as you are only prompted the once and not on each worksheet? I picked 30 rows because the amount of rows in each worksheet varies but never exceeds this. The end of my code "Delete rows where cell B is blank" will delete any excess data where 30 rows of week numbers etc are not needed.
Sub CleanCost1_1()
'
' CleanCost1_1 Macro
' Macro recorded 04/09/2009
'
' Delete Job Card Sheet
Sheets("Job Card").Select
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
' Delete Master Sheet
View 9 Replies
View Related
Nov 20, 2006
I have a button. When pressed, it runs a macro. Instead, after pressing the button, I would like the user to confirm to run the macro and display some info about it. This is to make sure the user does not accidentally run the wrong macro (button). I just need a prompt box, with a line info, and the two choices YES and NO. If NO is selected, nothing happens. If YES is selected, macro continues.
View 6 Replies
View Related
Oct 5, 2007
I have created a macro, but running the macro will replace the data that are already in the cells. So what I would like to do is to have a pop-up window come up when clicking the macro button asking if you really would like to proceed
View 2 Replies
View Related
Jun 20, 2014
Macro to Run all tabs in a workbook and prompt a pop up asking about sheet protection for each tab, such as Select locked cells, and select unlocked cells.
View 8 Replies
View Related
Feb 26, 2009
I have created an Excel sheet that retrieves data from a ODBC source. I have created a macro using macro recorder to refresh the data by re-connecting to the database. However, the connection requires a password prompt and when the macro is run, you are still required to enter the password.
Is there anyway to make the macro so that the password is automatically entered and the user will just have to press a button to fully run the query update?
View 2 Replies
View Related
Dec 18, 2009
Looking to write a macro which includes a prompt to the user for use in Excel 2007.
Specifics....Have a workbook including many worksheets with a common layout. Would like to write a macro to copy specific defined ranges from one worksheet to another but within the macro it would prompt the user to type in the worksheet name to copy the ranges from.
Example....User is at worksheet C in the file containing worksheets A, B, C, and D. User starts the macro and a prompt comes up for the user to input the worksheet name to source the ranges from (in this example A). User types in "A" in a dialog box and the macros copy/pastes the contents from range B4:B35 and Z2:z20 from worksheet A into those same ranges in worksheet C.
View 5 Replies
View Related
Feb 22, 2014
In a workbook, I use a macro to extract a sheet and save it as xls.
What code should I use to prompt the user to define the location and name of the new file to be saved?
View 1 Replies
View Related
Nov 12, 2009
Macros are just not my strong suit. I can usually find my answers here but this one has me stumped. I have rewritten this thing everywhich way but loose and this is my latest version.
Sub SetProtect()
'
' protect Macro
' prompts for password protection
'
' Keyboard Shortcut: Ctrl+p
'
Dim Response As String
Dim Answer As Integer
SetProtect:
Response = InputBox("Enter password")
If Response = "safety2" Then.......
View 9 Replies
View Related
Jan 22, 2008
I am using VBA to create a weightloss calculator and everything is going fine ecept the Vbyesno boolean that will not allow me to delete the data that i want.
I used a macro to delete the information that i want to delete and i know it works because without the vbyesno, it works fine.
With the vbyes no, both yes and no do nothing when clicked and the yes no box just closes.
The macro code is stored in a private sub called "ClearAll"
My code is:
Private Sub Restart_Click()
Dim Response As Boolean
Response = MsgBox ("Are you sure",YbYesNo)
If Response = VbYes Then
Call ClearAll
End If
End Sub
What am i doing wrong?
I also want to make the no button the default, how do i do this in conjunction with the code above?
View 4 Replies
View Related
Dec 29, 2008
For a sheet that many non-expert users will use on different systems I need a macro that let's them save, print and send the results of their work. So I made a macro that makes a copy of only 1 sheet of the workbook and saves it with a given name to a given location. The problem is that I want a location prompt to ask the user where they want the file saved, while giving/suggesting them a fixed filename. A lot of different users will make and use their sheets so I need a certain naming policy to manage all the files. (date, location, etc)
View 4 Replies
View Related
Jun 19, 2013
I have got a protected sheet with macros, how can I ensure that users can only open the sheet as Macro enabled only otherwise the sheet would not open?
I understand that some users may have different Macro security settings?
View 1 Replies
View Related
Jul 22, 2013
I have a Macro which deletes a sheet called "Pre selection" with:
Sheets("Pre selection").Select
ActiveWindow.SelectedSheets.Delete
It asks me every time if I am sure and I have to click to continue. Is there any way to remove this prompt or set it to continue without my intervention?
View 3 Replies
View Related
May 2, 2008
I need a macro which collects data from two files and dumps it into a separate spreadsheet. I need it to prompt the user to select the two files, since the file names may change.
Once a user selects the files, the macro simply opens them, grabs the data (the data sits on a single sheet in each file) and pastes it into a file, and closes the 2 data files.
The Data sits in A7:N20 on both files.
View 14 Replies
View Related
May 10, 2007
I am looking to find a way and synthesize code that will prompt the user for text data when he/she clicks a radio button, then place that text data in a "Notes" worksheet within the same workbook. Given that there are multiple radio buttons, with options of "OK" and "attention needed" (it is a checklist of maintenance items), I also need to find a way to have each note listed sequentially in the notes worksheet. My questions: Is this possible using macros? Can you steer me in the right direction? (change event, inputbox, then what?)
View 3 Replies
View Related
Sep 9, 2013
Its been a while since I did this on 2003 and needing a pointer on 2007.
Just needing a simple macro that opens the relevant folder from a hardcoded path to allow the user to manually select the file to be used.
This file will then be used to copy from and paste to another file.
View 8 Replies
View Related
Jul 7, 2008
I am setting up a "save as" macro that saves a file by replacing another file in a folder. Even though the macro has been recorded by approving the replacement (the prompt appears "the file --- already exists. Do you want to replace the existing file?"), when I run the macro, I am again prompted about replacing the file. Is it possible to avoid the prompt so the file is automatically saved by replacing the named file?
View 9 Replies
View Related
Sep 18, 2008
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 14 Replies
View Related
Mar 14, 2014
I have an excel sheet wherin there is a column that has the data where in the dates are displayed and many other columns.
I get this excel every Thursday so i want to filter this date column in such a way that it give me the data related to the date of the previous week only yet there is a catch here. When i say previous week i mean.
Suppose today is 03/14/14 then i want the data from 03/07/14 till today ie Last week friday to this week full( so cant use Current week option) and then paste it in a new sheet.
I tried the Record part but in that it is taking a hard coded value as i am selecting the date myself. I dont want to change the date manually every time.
this was the macro that was created
Code:
ActiveSheet.Range("$A$1:$BX$58").AutoFilter Field:=1, Operator:= _
xlFilterValues, Criteria2:=Array(1, "3/10/2014")
Range("A59").Select
ActiveCell.FormulaR1C1 = "=COUNT(R[-4]C:R[-1]C)"
Range("A60").Select
View 8 Replies
View Related
Apr 26, 2007
I have data in 3 columns: Name, Inclusion Date, Exclusion Date. In some instances, the inclusion date and exclusion date will be zeroed out - I do not wish to count those. What I would like to count is the rows that have an inclusion date, but not an exclusion date. Ideally, I would like to have a code so that when I run a macro a msgbox appears that indicates how many members there are.
View 12 Replies
View Related
Jun 3, 2009
In column L on sheet1, I want the user to type in a number. That number will be the number of recommendations that need to be done.
Once "L" is populated I would like the user to be prompted to fill out
-what the recommendation is
-date in should be finished by
corresponding to the number that was typed into "L" which would be listed onto a new sheet. So if the user typed in 3 - I should have 3 recommendations with dates.
On my new sheet, I would like "A" to match "A" from sheet1 for the first one only
"B" would be the recommendation from the prompt
"C" would be the date of that prompted recommendation
Name - Recommendation 1 01/01/10
<blank> - Recommendation 2 02/02/10
<blank> - Recommendation 3 02/03/11
View 2 Replies
View Related
Mar 19, 2012
Is it possible to prompt the user for a specific row number to delete in a vba textbox? If yes, then the code would fire using a button. I have the worksheet protected and only want to unprotect through code to delete a specific row number, then protect it again.
View 5 Replies
View Related
Oct 10, 2007
I'm in search of a way to prevent people who use a spreadsheet of mine from screwing up formulas. I've hidden rows 10 and 12 in a spreadsheet. i have a TOTAL formula in a cell on row 13 that counts from 10-12. that way, when people insert rows, the total is always right. problem is, people somehow seem still screw it up.
I'm hoping there's a way for me to put a button on the sheet to insert rows. and when the button is pushed, be promted to enter a number of rows. then have it insert that many rows.
Is that feasable?
Thanks!
View 9 Replies
View Related