I want to make a chart with the time in x axis and all of the S in the y axis. The problem is I want to be able to choose which S that I want to put in the chart. Example, I want to make 2 chart with S2,S3 and S5 in the first chart and S1 and S6 in the second chart. What I want is when I click the button 'chart', a pop-up appear and ask which S that I want to include in the chart.
Excel 2007 Q: I have a combo box (ActivX) that I want to be able to choose a a date from a range of dates in column A on sheet 'Working Copy'. I want a cell to update with the number/position of the date when the date is chosen i.e. the first date in the range yields 1 the second date yields 2 and so on. I also want the date to be displayed in dd-mmm-yyyy format. I am able to get the cell to give the correct position of the date but the date reverts to five digit number in combo box. I can change the code to return the correct date in the combo box when the date is chosen but then the cell just returns 0.
How can I make it so that the combo box returns the correct date and the cell updates with the position instead of jsut one or the other?
Here is the code I am using
Private Sub ComboBox1_Change() ComboBox1.Value = Format(ComboBox1.Text, "dd-mmm-yyyy") End Sub or Private Sub ComboBox1_Change() Sheets("Working Copy").Range("G1").Value = ComboBox1.ListIndex + 1 End Sub
We have several salespeople who maintain a workbook tracking their workflow. I want to compile the customer account number, account name and deal number for each rep to another workbook. A new sourcebook is started each week. This code is in the target book
Public sourcebook As Object 'the workflow workbook
Dim wsc As Double 'the number of pages in the workflow
Dim col As Long 'the column in this workbook for returning values
Dim IntEndRow As Double 'the end row in this book
Dim SrcEndRow As Double 'the end row in workflow
Dim findval 'the column workflow where the sourcedata is found
My code allows the user to select a workbook and then loops through each sheet in that book searching for the column which has the info I need, this changes on each sheet as the reps each deal with different types of customer as so take different details. I solved this by having column headers in the target book and searching for them in the sourcebook.
This code works when I step through it but falls over at the "Set sourcebook" line when I run it where it returns a breakpoint error.
I've have a spreadsheet where 4 cells are linked to another workbook via a vlookup. the problem i have is that a lot of users can update this external book, or it can be saved as a seperate spreadsheet somewhere else on the network. If it was up2 me i would have them only update the one sheet, but as it stands its not. So what i want to be able to do is put some code onto a button on the sheet, from here i want the: Application. GetOpenFileName
method to open....but from here i want them to be able to pick the cells where the data is situated. Any clues..... i can get as far as them selecting a workbook. Do you think i will need to create another userform?? Maybe RefEdit? I'm not sure.
I have two columns, Account Number and Account Type. I already use Data Validation on Account Number to make sure it is numeric and on Account Type to make sure the user picks from a drop-down list. I want it so that if a user inputs an account number, it forces the user to automatically pick from the drop-down menu in the account type column, otherwise post an error.
I am making a macro that requires that user to enter a directory path into a input box and the macro will open the file. Right now it works fine bit i would like to change the code so that instead of using an input box it brings up a box that will allow them to browse files on their computer and then select one to open.
If possible could someone please help with changing the below code so that column "D" in the rngIn part of the code can be a variable. i.e so the user can select one, two, three or four columns (with visible data) to be copied. The "b3" part is a constant.
There must be a VBA command out there, with which one can call the color panel such that the user can then choose his/her preferred color, I just cannot find it. Could you help me out?
With Color-Panel I mean this little interface you get when manually changing the font-color or the fill-color. (it consits out of maybe 8 colors in a row and 5 colors per column and usually has a button "automatic"). I would like to call that interface such that it gives back the color-index of the color choosen by the user.
conditional Macro or filter? Easy to record a Macro which filters, but choosing what (column) to filter based on values of a cell I'm not sure how to go about that. It means implementing IFs into a Macro, or..?
Data on "Staff List" sheet I have a list with all staff details including availability. I need to filter their availabiltiy and copy values over to another sheet. The availabiltiy shows Monday to Sunday and states for which of our offices they are are available. Here the columns BS to BY
Available Location Monday Available Location Tuesday Available Location Wednesday
Now I need the Macro to choose which column to filter based on the office set in cell C3 on the "Availability" sheet. And then filter that column for YES.
I have a spreadsheet listing various pieces of computer hardware, software and mobile accessories, etc with costs attached.
I have created a dropdown list of staff profiles eg a sales representative, finance assistant, IT administrator.
What I want to do is get Excel to pull the data through from the data sheet, to a printable summary output form (something you could also cut and paste from). For example, a sale rep would need to be set up with a laptop, laptop case, mobile phone, etc, so when you select Sales rep from droplist, I want that action to pull all the associated data through to the summary form. Similarly, a Finance assistant would require different kit , perhaps a desktop PC , monitor , etc.
Next to my data I have created columns with "Y" for yes in cells containing kit that match the staff role requirements, but I am not sure of the best way to pull this together.
I have a form that asks at what row the user wants to start with a selected range then how many rows to select. There will always be 21 columns selected with this range. I am still learning but it has to do with something on how I am setting the Start object. It is not being recognized.
Dim Row As Long Dim Selection As Long Dim Start As Range
This code works fine if i use static ranges, but i would like the user to input the column in which the data is stored.
'Get data for the locations of the gaming license numbers needed for the comparison varPlayerHost = InputBox("Please enter a single letter for the" + vbCrLf + _ "Column that the Player Host License" + vbCrLf + _ "numbers are in.", "Player Host Number Location", "H") varHostLicense = InputBox("Now enter the column letter for the copied employee" + vbCrLf + _ "license numbers", "Employee License Number Location", "U")
'Set the ranges for the data to be compared 'This is where I am getting the error??? Set rRangeA = Range([varPlayerHost,1], Range(varPlayerHost, 65536).End(xlUp)) Set rRangeB = Range([varHostLicense,1], Range(varHostLicense, 65536).End(xlUp))
'The actual comparison and deletion of record that match the license numbers copied. 'When this function finishes you will be left with a spreadsheet that only has patron 'information left for the patrons that have an invalid host number. For Each rCell In rRangeA If WorksheetFunction. CountIf(rRangeB, rCell) > 0 Then rCell.EntireRow.Delete End If Next rCell
This exact code is kicking an error "Run Time error 1004" "Method 'Range' of Object '_Global' failed" Not quite sure where i went wrong.
I am writing a macro in which the user selects several ranges (entire columns) for the macro to manipulate. I display a userform to the user that contains 16 refedit objects (1 for each range that they picked). Unfortunately, the value that appears in the refedit boxes is not very user-readable. It looks like this:
I can assume that all of the ranges will reside in the same workbook, so I have been cutting the workbook name portion off as a string and displaying it in 1 place only. I can leave the value of the refedit as: Sheet1'!$B:$B, but even that is not very friendly. Of course if I do change the value of the refedit controls then I will need to "fix" them before attempting to access the range.
Does anyone have a suggestion as to how to display the sheet and column of the range to the user?
I'm trying to get a users' selected range to display in a cell as stored text.
therefore, If a user selects A1:D7. The text in Cells("G", 10) will be:"A1:D7"
w/o the quotes.
I've attached an example workbook. Here's the formula thus far:
Sub SelectRangeBox() Dim rnBody As Range Dim vaMsg As Variant Do vaMsg = Application.InputBox( _ Prompt:="Please enter the message-text:", _ Title:="Message", _ Type:=2) Loop While vaMsg = ""................................
Actuall maybe my thread should be Titled. user selected cell range displayed in input box save to cell as a text value.
I'm having some issues getting a tool I'm working on to function correctly. I have some cells, the number of which can vary based upon user requirement, that contain cell addresses. What I need from VBA is to translate these addresses into usable row, column values for the user defined range. Example:
Cell D4 contains F14, which was input by the user.
What is the best way to pass this data through VBA. Right now I am currently using:
Dim strRange as String 'left out loop parameters dim TempRange as Range strRange(i) = Cells(4, 4) 'using TypeName on StrRange at this point yields a string result as expected set TempRange = Range(strRange(i))
From my understanding that should work but I am getting type mismatch.
I do not have any reason for actually using a string, but would like the user input to only be 1 cell. If there are cleaner ways around this, I am open to them.
Then from the range, I would have two other variables as type long for storing the row and column data using:
What I need to have happen is that the user decides what duplicate row to delete. The reason that there is a duplicate is that Row 1 has something different from Row 2. In my example above, CU1 is different from CU2. This is what caused this loan number from CR to be duplicated. I need to delete at my discretion one of the 2 rows.
What I would like is to have the user Select Range CR1:CR2 (this is relative in the sheet), run the macro, have it select the 2 row range, compare (relative) B1:B2 are they equal, compare C1:C2, are they equal, etc through the rest of the range. I would like the screen to update and stop with the range highlighted that is and and a MsgBox to click ok to Continue, then continue through the rest of the range. Once it has finished cheking the range, can the user use the mouse to select the range from CR that needs to be deleted, have the appropriate range selected and then the MsgBox Is this the range you want to delete? Y/N........................