Can I pass Combobox as a parameter to other function. If yes then how? I can pass Combobox1. Name as a parameter to other function but inside that function I cannot use combobox("Comboboz1.Name"). I don't know the syntax to work on the combobox whose name is passed as a parameter.
I delcare an array of dates and assign it with a function that returns an array of dates. Then I want to pass the result to a sub which takes an array of dates as a parameter. However, I am getting a type mismatch error on this line
I have an MS Access query that contains a parameter. The parameter is a date field, and I have configured that in the Access query. If I run the query within the MS Access user interface, it prompts me for the paramater value as expected, and runs just fine. However, I want to connect to this query from within Excel as a data source.
I have created a connection to the Access file using ODBC from within Excel. In the MS Query window, I am merely selecting all of the fields resident in the MS Access query, and returning all values. In other words, there is no selection criteria in the MS Query. I have done this many times with Access queries that DO NOT contain a parameter, and everything works fine. However, in this instance, I need to pass a parameter through to MS Access in order for the query to run. At the moment, I get the "Too Few Paramaters...1 expected" error message. This makes sense, because I haven't figured out how to pass the paramater to MS Access.
Is there a way to structure this that does not involve VB code? If so, I'd love to know how. I have tried creating parameters in MS-Query with the same name, but although I get the prompt it doesn't connect with the Access query as the source for the parameter value.
If the solution requires using code, I'm good with VB Code in Excel...is there VB for Excel code that could make this happen?
Failing that, I guess there must be (I've seen a few in my search thus far) Access VB Code that can make this work. I'm very rusty using VB with Access, so this is my least favored solution. However, if this is the only option, keep in mind that I need to pass the paramater ultimately from a user who will initiate the process using Excel.
I though I could do this with a nested IF statement but it is too cunfusing for me. What I am trying to accomplish is this:
Experiment Is Steward EU ID Location Data Quality GE Entry Order
I want to have a screen pop-up asking me what my limit < would be for column "ESTCNT" so if I put in 25 or any other number that it would highlight all the rows that are less than 25, then look at the row above and below and if it matches the same number (that is in the cell "Range" of the highlighted column) in column "Range" then copy that row to a new sheet. Meaning all tha rows that match the "Range" would be in the same new sheet.
The rows might be different lengths and that there will not always be a number in cell "ESTCNT". Column headers will always be the same but might not be in the same column each time. And if it is not to hard once it is completed to find column "SPPLOT" in the new sheet created and asking what I want to autofil the column with.
I have a macro that adds a row with predefined formulas and formating. The macro is launched by clicking on a button. However, I would like to make it possible to add more than one row at a time. My plan to do this was to use the number of selected row as input to the current macro. If the user selects row 1,2,3 and 4 (or 15, 16, 17 and 18, and so on) four new rows should be added. I would just add;
I am using a spreadsheet with two sheets, basically, one sheet has a combo box control, you select a name from there and click on "Go". The function is supposed to go into the next sheet (Sheet2) and retrieve a value from there (in the same row as the selected name).
I am using the following code (on button click):
Dim strValue As String Sheets("Sheet2").Select strValue = Range("A1").Value MsgBox (strValue)
I've simplified this, but essentially my problem is this - it isn't picking up any value at all - there is text entered in A1 so what is the problem?
I can't use code for this problem as I need to give this to someone who doesn't know VBA. They will need to use it in several different reports, so I can't produce something in VBA very easily. I have three worksheets, Summary, Year1 and Year2.
I want to display either Year1 or Year2 data in the Summary sheet depending on what the user enters in a cell in the Summary sheet. For example, if the user enters "Year1" in cell E2 then I want to point to a cell in the Year1 spreadsheet. I tried using formula: =E2 & "!B3" but this doesn't work. Is there another solution? I have attached an example.
I am using Excel 2010. I have a user form with a date picker on it. I simply want to transfer the date chosen to cell A3 on a sheet. I have two problems. When I click the date picker, it doesn't show all the days of the month. When I do pick a date, it isn't transferred to the sheet. This is the code I am using in the user form:
VB: Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date) meetdate = UserForm2.DTPicker1.Value Sheets("MeetData").Range("A3").Value = meetdate End Sub
My spreadsheet is populated by data coming from MS Query, i'm entering a parameter value to display the desired data in my spreadsheet. My problem is, i have to close and open the file to have the parameter prompt so in that case i can enter the parameter value.
Is there anyway to call the parameter prompt so i will not open and close the file, its really time consuming...
If possible, i just want a command button that calls the parameter prompt.
Looking for a formula that gives the 1st - 5th day of a month, using the day name, e.g. "First Monday of March 2009" returns "2". Even better is if it could accomodate previous and following months, e.g. "First Monday of Next Month" returns "6". 3
I have a a table at the top of my worksheet which is a breakdown of performance. (Table 1), i would like Table 2 to roll up performance using a =SUMIFS calculation. However number of rows in table 1 may vary.
Last time i got macro from this forum how to import files automatically. I am importing the data from the specific folder.In code itself we are hardcoding that file names.But in that folder i have lot of files is there any option to pass any parameter value.That means each time it will asks for filename(Prompt).Once you give file name it will automatically load the data.
How do I adjust the VB code below so when the user clicks the command button they are prompted to set a limit. i.e the code only runs til it hits the limit and stop (instead of running until it there are no more x in the columns)
Row 2, Col 9 stores the column numbers (listed as 1, 2,.....100) so thought this could be used in some way.
1. how do i set up the code so a user can enter a parameter value e.g 50 (which is the limit but also includes the values in column number "50")
2. how do i adjust the code so it take the parameter value and stop when it reaches column number "51"...
What is the best way for my UDF to return an error to the calling worksheet if it detects an invalid parameter?
In the past, I have usually set a breakpoint so I could check the the values and the logic. Other times, I return an invalid result, like 0 or -1.
I am working on a UDF now that is called hundreds of times. The workbook is a work in progress so I am constantly making changes to the UDF and the calling cells. Periodically, I screw up and do something that causes every call to get an error (like divide by zero).