does excel have a function or some kind of method where you can have it display the range of cells that you have selected? For example, if I highlight cells A5:G7 what would be the code for excel to display "A5:G7" in a message box? I need this to be dynamic, so the next time I select cells B3:T32, it needs to display "B3:T32."
I have some data validation drop down lists in excel, I can tab through all the lists but I have to press alt + down arrow to show the list, Is their a way it can be automatically shown as soon as I focus on the tab.
Possible to get a pivot table to automatically expand the range selection of data as it grows. I have a worksheet that grows daily and I am running a pivot table from this. If I refresh the pivot table it doesn't pick up new data unless i change the range or i have a huge range selected in the first place. Problem is if i select a huge range then the grouping options i am using won't work correctly.
Code: Dim selection As Range Dim minimum As Integer Sub Sequence() Set selection = Range(Cells(4, 3), Cells(6, 5)) minimum = Application.WorksheetFunction.Min(selection) ' and now I need an address of that smallest number for this: ' IF (column number + row number) > value of that smallest number ' do End Sub
It's not exactly the program I need, but it's simple.
I am wanting to allow the user to select a cell in a worksheet and return the cell address and information/value from the cell. For example, if "Dog" is in cell A1 and "Cat" is cell A2 and the user initiates the Macro I would like the macro to to pop up a message box and say something like "Select a cell in Column A". When the user clicks on cell A1, I would like the message box to pop up and say, you selected "Dog" in cell A1.
i have a an invoice template setup on my computer in excel.
what i would like to know is how do i get my customer address to automatically fill in (cell b) if i select them by customer number (drop down menu in cell a) in an different cell (cell c)
I have inserted the sheet. As you can see in Sheet 1 I have the Store, Address, Town etc, I would like a drop down box in D13 ( Store Name ) so when I select a store it will automatically fill all the info into D15:D19 Address, Town etc. The info will be pulled from Sheet 2.
So in a nutshell, There is a month key pivot field which contains all months. Now I only want the current month and the previous month. These 2 variables have already been prepared and work. maand = current month and pmaand = previous maand. They both resemble a selectable pivot item for pivot field "MonthKey".
[Code] .......
Now I want to replace 04.April by pmaand and 05.May by maand.
However I always get an error and I tried without "" and with "" in several positions but it is not working.
I have selected 6 rows and 2 columns in a sheet and I have a button in the same sheet.Now I click the button it triggers the button_click where I have put msgbox to popup.But I need this selected value in message box instead of the my hard coded string.
Im currently creating a spreadsheet for my work, with common problems and solutions to one of our websites.
When the spreadsheet is opened, the user will click a button depending on what sort of problem he/she is having. In the example attached, if the user clicks on "make payments" a form will appear. This will have a list of problems.
if the user choses problem 1 from the drop down list, then I would like the list of solutions to problem 1(from the MPData sheet) to show in the box below. The same goes for problem 2, problem 3 etc.
I want to select a customer name from a ComboBox in a UserForm and populate a TextBox with additional customer information for the end user. The additional customer information is always located in C3 in sheet2 (the result of a formula). However, the text box only refreshes when I click into it. Is it possible to have it refresh without clicking into the userform textbox)? I’ve tried _Change and _Afterupdate. I'm sure this must be easy for anyone but a novice like myself. Sample attached (play marco...button dead?).
Private Sub ComboBox1_Initialize() Me.TextBox1.Text = "" End Sub Private Sub ComboBox1_Afterupdate() Me.TextBox1.Text = Worksheets("Sheet2").Range("C3").Value End Sub
I have the following code pasted into the worksheet module which used to work fine but no longer does. I didn't touch the code, it just stopped working.
Private Sub WorkSheet_Change(ByVal Target As Range) Select Case Target.Address Case "$A$16" Select Case Target Case "Custom Color 1": Call CustomColorInput1 Case "Custom Color 2": Call CustomColorInput1 Case "Custom Color 3": Call CustomColorInput1 Case "Custom Color 4": Call CustomColorInput1 Case Else: End Select Case "$A$17" Select Case Target Case "Custom Color 1": Call CustomColorInput2 Case "Custom Color 2": Call CustomColorInput2 Case "Custom Color 3": Call CustomColorInput2 Case "Custom Color 4": Call CustomColorInput2 Case Else: End Select Case "$A$18"
CustomColorInput 1-6 are the same except they input data into different cells F16-F21.
When I attach any of the CustomColorInput macros to a button it works fine. When I try to call it from the worksheet module, the data input box pops up but the data doesn't get entered into the cell. When I try to step through the CustomColorInput macros using F8, the input box pops up, I enter data and press ok. Then I continue with F8 and the debugger jumps to a custom function that I entered (below), which is not called for and is in no way related to the code.
Function PullAfterLast(rCell As Range, strLast As String) PullAfterLast = Mid(rCell, InStrRev(rCell, strLast) + 1, 256) End Function
When I close VBA, the data that I typed into the data input box is in the correct cell.
So basically, I'm getting three different responses from the offending code depending on how I call it up. Can anyone tell me what's going on?
More generally, in this and previous occasions, I've had problems with macros that cease to work for no reason that is apparent to me. What are some things that would cause a macro to stop working, without actually changing the code (other than the obvious, like referring to names or worksheets etc. that don't exist anymore)?
Basically I have a form where the list can expand and contract so there will always be varying row lengths.
What I would like to see is a drop down list that shows a) the actual populated field and b) a description of the field when the drop down list is present.
I believe this can be done with a combo box however that would be a lot of work.
I use this ok code to increase the font in the selected cell:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim TargetRange As Range Dim isect Set TargetRange = Range("C:D") Set isect = Intersect(Target, TargetRange) If Not isect Is Nothing Then Columns("C:D").Font.Size = 11 Target.Font.Size = 15 Exit Sub End If Columns("C:D").Font.Size = 11 End Sub
The problem is when i press ctrl+c to copy a cell content, so once i move the curser to the distenation cell then the copying mode in selected cell disappeared. It is because when the event is trigered then the copying mode stops. The question is : how to let the copying mode works even when the event is trigered ?
I have an embedded chart on my worksheet.I can select a cell behind the chart using the keyboard arrow keys.Is there a way of doing this using a mouse click,so that I know which cell i am pointing to/choosing?
So I have a quote format with various different products:
B1 to B10 Contains a vlookup with stock codes from another page. C1 TO C20 Contains drop boxes with various different stock items. Some of the stock items are available in singular form and others are in kits. I.e C1 could contain whats in C2. I want to be able to select C1 and have the sheet automatically pull up c2. But I dont want to loose any data that is in c2, in other words I still want to be able to manually select C2.
I have a userform with a CheckBox and a ListBox. Is there a way to have the CheckBox to automatically get checked if a selection is made in the listbox?
I am working on a spreadsheet for a client. I am using Excel 2007 and she is using Excel 2000. I have created a emplate for her to enter survey data into. Using the following code, I have created combo boxes for the drop-down menus so the client can tab from one cell to the next while entering data:
Option Explicit Private Sub TempCombo_KeyDown(ByVal _ KeyCode As MSForms.ReturnInteger, _ ByVal Shift As Integer) 'Hide combo box and move to next cell on Enter and Tab Select Case KeyCode Case 9 ActiveCell.Offset(0, 1).Activate Case 13 ActiveCell.Offset(1, 0).Activate Case Else 'do nothing End Select End Sub.....................
I have a named range that expands and contracts based upon the amount of data that is in some column. Call it AllData_UsedRange.
I have another named range that actually refers to a range. Call it AllData.
Column A Row2 56 Row3 44 Row4 65
AllData is a named range that refers to the range A2:A65536 AllData_UsedRange refers to A2:A4 by way of this formula. =OFFSET(AllData,0,0,COUNTA(AllData))
How to I obtain an address of AllData_UsedRange in VBA code?
These do not work... ThisWorkbook.Names("AllData_UsedRange").RefersToRange.Address Evaluate(ThisWorkbook.Names("AllData_UsedRange"))
I have created a UserForm that has a ComboBox and depending on the number selected I want it to show that number of Labels/TextBoxes...
So if I select "0" nothing is shown, if I select "1" one set of Labels/TextBoxes is shown, select "2" and two sets of Labels/TextBoxes are shown... but also if I have selected "2" and then select "1" I want the second set to be hidden again...
Also I know I should have renamed the Label/TexBoxes to make it easer but I was adding things and making it up as I went along...
I'm using Excel 2010 on windows 7.
Code: Sub UnHide_NewRoutings() If (Engineering.ComboBox2.value) = "0" Then Engineering.Label4.Visible = False Engineering.TextBox5.Visible = False Engineering.Label9.Visible = False Engineering.TextBox9.Visible = False
I have protected a few hidden columnx in my worksheet and have sent it to my client who has the password.
He had a complain. Every time he wants to unhide the columns, he gets an alert to unprotect the workbook. The process of going to the Review tab and pressing the unprotect tab is what he finds annoying. My questions is the following; Is there any way that the password box immediately appears once he attempts to unhide the columns?
I need to make a dropdown list (I know how to do that) and based on that selection, I need some cells below to automatically complete. How can I do that? Is it possible with or without VBA?
Sheet 2. A1: Drop down datavalidation list selected from A3, sheet 1.
On sheet 2, a user can select from the list. If a user changes the value in A2, sheet 1, I want the value that is associated and already selected in A1, sheet 2 to automatically update. There is a 1 to many relationship with the concat and the drop down. In that, sheet 2 can have multiple rows with the same value from sheet 1 A3. Is there a way when A3 sheet 1 changes, to search in A:A in sheet two and update the values for those records that match the original value in A3, sheet 1?
I know that I can return the value of a defined name range, the address, and even the value of the define name, but if you are given a range address, how do you find its corresponding defined name in code?