Re: Display a certain Worksheet based on drop down list
NBVC, I got it to work! Thank you sooo much for all your help!
Re: Display a certain Worksheet based on drop down list
NBVC, I got it to work! Thank you sooo much for all your help!
Re: Display a certain Worksheet based on drop down list
I used Worksheet_Change
Re: Display a certain Worksheet based on drop down list
Yes they match exactly and I did make sure I changed all of the A1s to D30s....Ok it looks like after I select the city, I have to click around on my Main page and then re-click on the drop down menu and then it switches to the correct tab...Is there anyway to make it so they click an "OK" button to activate the code? Would that be easier?
Re: Display a certain Worksheet based on drop down list
Thank you. I tried that but I get a subscript out of range message. I changed the reference cell to "D30" on the "Main" tab since that is where the drop down list is. When I choose a city from the drop down list (I created that in Data Validation) nothing happens...My drop down has about 20 cities. So if the user chooses Miami, then I need for the tab labeled "Miami" to appear in something like a display box....I hope this makes sense.
I have a drop down list for the user to choose a particular city. Depending on the city they choose I need for that city's "tab" to simply be displayed.
I am in need of VBA help with calculating the distance between two cities. The starting point will change depending on the employee, but the destination will remain constant. I need for it to then give me the mileage in column J and Travel time in column K for each person. I have looked at other codes and can't seem to get anything to run correctly.
Re: Code to calculate total length installed based on number of pages that are entere
Adrian,
That worked perfectly THANKS!!
Re: Code to calculate total length installed based on number of pages that are entere
Bryce: I cannot post a sample workbook...what I deal with proprietary. However, the equation is simple. =(B13*B14)/12....this information is stored in cell B15 on any page that is added. So if I add 15 pages I need all of the B15 cells to sum and place the sum on my "Main" Sheet. But I need it to recognize that if I start with say 15 pages and then I decide to add 4 more pages, it will sum the additional B15 cells.
I have the equations to calculate the data is entered (daily total length installed), but I need the equation to add each daily based on the number of sheets the user requires. The equation would pull the data from the same cell reference(just different sheets). For example: if the user enters 10 pages, I need the code to add the data from the 10 cells and place it on my main screen. But if the user only needs 5 pages, I need it to do the same. It would also need to be able to recognize that the user has added a sheet after the project has begun (I have this option setup for them using an ActiveX control).
Re: Save Log in Information to the next line each time Workbook opened
Thank you...it did!
Re: Save Log in Information to the next line each time Workbook opened
Thank you for the help. However, I am not sure what has happened, but I am stuck in a infinite loop when I open the workbook. It will not go past the "Enter your name" box. How do I fix this? lol
I have the code to force the user to enter in their name/date/time when they open the workbook. But I do not know how to get it to save to the next line and not overwrite the same line each time.
Sub AddNameandDateForAccessLog()
Dim myValue As Variant
Line1:
myValue = InputBox("Please Enter Your Name for Access Log")
Sheets("Main").Range("A35").Value = myValue
If Range("A35") = "" Then GoTo Line1
Dim myDate As Variant
Line2:
myDate = InputBox("Please enter today's date in mm/dd/yyyy format")
Sheets("Main").Range("C35").Value = myDate
If Range("C35") = "" Then GoTo Line2
Dim myTime As Variant
Line3:
myTime = InputBox("Please enter the time including AM or PM")
Sheets("Main").Range("F35").Value = myTime
If Range("F35") = "" Then
GoTo Line3
End If
End Sub
Display More
Re: Force the user to enter name/date/time before they can continue and save to new l
I found my mistake on the End If Error. I greatly appreciate your help Mr Sidman.
Re: Force the user to enter name/date/time before they can continue and save to new l
Mr Sidman,
The additional code you provided continues to give me an Error "End If without block If". What I am needing is when the workbook is opened, the user is prompted to enter their name, date and time (and to ensure they cannot go further until they do). I need that information to be stored(which it will when they save it), but when the workbook is reopened the last information is not overwritten. Essentially it is a log book...
I have code written for the user to enter their Name, Date and Time when they open the workbook. However, I do not know how to make it so they have to enter that information before continuing, or how to write the caode to save the information to a new line each time they enter the workbook. I need this to be a log...
Sub AddNameandDateForAccessLog()
Dim myValue As Variant
myValue = InputBox("Please Enter Your Name for Access Log")
Range("A35").Value = myValue
Dim myDate As Variant
myDate = InputBox("Please enter today's date in mm/dd/yyyy format")
Range("C35").Value = myDate
Dim myTime As Variant
myTime = InputBox("Please enter the time")
Range("F35").Value = myTime
End Sub
Display More
I have written code to prompt the use to enter their name, date and time. I need the code to save the data in a new line each time the workbook is opened. I also need to make sure that the information is entered before they can change data on any other sheet. I have also written code for the user to enter in the number of sheets they need added, but it produces a blank sheet and I need it to copy all the data from "Sheet2" to the new sheets and all new sheets to be placed after "Sheet2". Below is the code for my first question:
Sub AddNameandDateForAccessLog()
Dim myValue As Variant
myValue = InputBox("Please Enter Your Name for Access Log")
Range("A35").Value = myValue
Dim myDate As Variant
myDate = InputBox("Please enter today's date in mm/dd/yyyy format")
Range("C35").Value = myDate
Dim myTime As Variant
myTime = InputBox("Please enter the time")
Range("F35").Value = myTime
End Sub
Display More
Here is the code for when the user enters the number of sheets they want:
Sub AddSheets()
'Prompt to add sheets to a New Workbook
Dim Prompt As String
Dim Caption As String
Dim DefValue As Long
Dim NumSheets As String
Prompt = "How many sheets would you like to add?"
Caption = "Tell Me..."
DefValue = 1
NumSheets = InputBox(Prompt, Caption, DefValue)
If NumSheets = "" Then Exit Sub 'Canceled
If IsNumeric(NumSheets) Then
If NumSheets > 0 Then Sheets.Add Count:=NumSheets
Else
MsgBox "Invalid Number"
End If
End Sub
Display More