Input Cell Address In Vba By Clicking That Cell
Jan 22, 2007Is it possible to input a cell address in a VBA macro by clicking in that cell?
View 9 RepliesIs it possible to input a cell address in a VBA macro by clicking in that cell?
View 9 RepliesWhenever she clicks on a cell, the cell to the right of it is also selected. When she tries using tab to move to a new cell, she can only move between the two selected cells. Same with using the enter key. As such, it is extremely difficult for her to modify only one cell, since she always has two selected.
The F8 key, as well as Ctrl+F8. However, pressing the F8 key only adds more cells to the autoselection, and Ctrl+F8 allows her to select one cell, but also highlights the cells around it, and when we tried to select other cells, every cell we clicked stayed highlighted.
Additionally, sometimes when she clicks a cell, it will just select that one cell. Click it again, and the problem is back. I haven't been able to determine any patterns to this behavior, and I know there is no problem with the input (the keyboard and mouse are standard-issue in our lab, and we keep them well maintained).
I would like to accomplish 2 things in my Excel 2010 spreadsheet by click a cell which already has a number and formatting in it.
1. How do I change the color of the cell, the color of the number in it, and the border around it. (Make it look like I just pressed a button by clicking it.)
2. At the same time have the text in different cell and the number in the selected cell appear in another different cell. (Text in a different cell = A , and the number in the selected cell = 23, the value in the resulting cell be "A 23") Everything I would like to happen at the same time by clicking the selected cell. I would also like this to be done several times by clicking different cells and not changing the previously selected cells.
I am basically creating a questionnaire style program where the user gets asked 50 questions, one by one and they input their answer and press another button (submit button). They initially press a start button to start the questionnaire.
So far, I have created a range of questions and it fills one row where the questions are entered. In intend to use a for loop to go though all 50 questions.
Now this is where I’m stuck. I have a submit button and after each question is displayed, I want the user to enter their answer and then click the submit button to then continue to the next question.
However, I can’t think of how to do this.
1.Firstly, how can I loop through the questions and yet allow the user to input their answers after each iteration?
2.Also can I even click the submit button during the loop phase? I.e. when already running.
I want to put my cell values into textboxes by clicking 1 cell
So example. I click B2 as active cell, then i would like to put all the values from row B (B1 : B10) in to different textboxes!
i want to click or roll over a cell with the mouse, to change the color of another cell, or another multi cells.
another question.
Is it possible to change the color of a pic i put in the excel using a function or VB.
I want to automatically put information from several cells into one cell, when these cells are clicked. Let's say that A1:J8 is the range were a cell can be clicked and if a cell is clicked in that range the value of these cells should be put in cell A9. If possible I want to avoid private subs in a worksheet. I preffer to have a macro running, so I can decide when to stop this routine.
View 3 Replies View RelatedAssume the following list of addresses are all in separate cells of a single column (A1-A4). I just need the formula to extract the street addresses, and then a separate formula to extract the zip codes.
5430-44 PASCHALL AVENUE PHILADELPHIA, PA 19143 OPA/BRT#: 884350845
4010 MARPLE STREET PHILADELPHIA, PA 19136 OPA/BRT#: 651087200
2618 SOUTH HOWARD STREET PHILADELPHIA, PA 19148 OPA/BRT#: 391251216
5737 WOODCREST AVENUE PHILADELPHIA, PA 19131 OPA/BRT#: 522155600
How to do VBA even for a basic one. macro that allows me to go to an specific cell from another sheet/tab when I click a given cell in the current sheet.
View 7 Replies View RelatedI would like to click on "B1" (making this a button) and have it add "1" to blocks "B9" and "C9". Both blocks would start out with "0". I would need it to add in sequential order everytime I clicked on "B1". Basically, when I open my document the very first time, "B9" and "C9" will read "0". When I click on "B1", they should then read "1". Then next time I click "B1", they should read "2", and so forth.
View 5 Replies View RelatedI would like to run a macro by clicking a cell. I don't want a toolbar button/menu item and Hyperlinks don't work. Can this be done?
More info: My macro selects the current row in Sheet A and moves it (cut & Paste) to Sheet B in the workbook. The macro then goes back to Sheet A and deletes the now blank row.
I'm wondering if it is at all possible to have a cell comment automatically update depending on what data is input in the cell (via user input, VLOOKUP, etc.)?
For example, if cell A1 contains the text "CHARLES" with a comment saying "Employee of the Month", and is then subsequently updated with the new text "JOHN" (again, via direct input, a VLOOKUP, data validation, etc.) is there a way to have the comment automatically update to say something else, such as "Team Lead" for example?
I've considered using VBA to accomplish my goal, but am unsure how to compose an effective code to do so. I've also considered perhaps creating a named table filled with all the different comment possibilities I would like to have used in this cell and then inputting a formula in either cell A1, or the comment contained therein, that would then call the corresponding text from that table based on the data in cell A1. Honestly, I'm not sure that what I'm trying to do is even possible;
i have made (found) a way to change the data in a cell by clicking on it, however i can only make it go from 1 to 0 or 0 to 1...heres the VB
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If (ActiveCell.Value = 1) Then
ActiveCell.Value = ""
Else:
If (ActiveCell.Value = "") Then
ActiveCell.Value = 1
End If
End If
End Sub
however, i would like the code to do a different task, i would like it to add one to the number everytime you click on it...i.e. it goes from 1 to 2 to 3 to 4 to 5 etc. everytime you click on it...
if it is possible, i would also like it to be restricted to a few cells, which i can determine afterwards and change
I have seen this on many spreadsheet but never figured out how to do this - click on a cell in a spreadsheet to open up a new spreadsheet?
View 4 Replies View RelatedI'm trying to do. I have 2 columns, both have empty cells with borders. I would like to make it so that when the user clicks one of the cells, it turns grey and the one beside it turns white. I set up two macros as follows:
View 3 Replies View RelatedI have created a macro that autofilter values in sheet 2.
In sheet1 I have a cocpit of values from Sheet 2, 3, 4 and 5.
In the monitoring cells in Sheet1 I would like to doubleclick (or similar) in the cell where I have a value from ex sheet 2, and then trigger the macro which does the autofiltering.
how to get a userform by double clicking a cell.
I have created a userform, (my first one)-very simple form, i have created a massive textbox, so when i doubleclick a cell in Sheet 1, userform pops up and I can write comments.
I am not sure how to write a code for this? I know it will have Private Sub Doubleclick, not sure on the rest?
I am trying without success to for a macro to run when a specific cell is activated. i.e. if a users selects cell A1, macro X will run.
View 2 Replies View RelatedI have programmed a Form in VBA that initializes by clicking a button on a worksheet. The Form features combo boxes, text fields, and a couple option buttons. Once completed, the Form enters the values entered by the user (as strings) in contiguous colums in a single row. The worksheet is locked so as to not allow users to input values into the worksheet directly and bypass the Form.
The question:
Once a row is filled by submitting the Form, i want to allow a click event on that cell (like double-clicking, for example) to pop-up the Form, but containing the corresponding values from the cells in the matching combo boxes, text fields, option buttons. I want to do this so that I can allow modification on a row without letting the worksheet be modifyable without passing through the Form. Here's the code for submitting the Form values into the worksheet:
Private Sub cmdSubmit_Click()
ActiveWorkbook.Sheets("ALTEC Growth Report").Activate
Range("A7").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = Trim$(txtName.Value)
ActiveCell.Offset(0, 1) = cboCC.Value
ActiveCell.Offset(0, 2) = cboProdServ.Value
ActiveCell.Offset(0, 3) = cboStatus.Value ..................
I want to display a comment/note that is always visible however:
*The text in the comment should change "only when" the user of my worksheet "clicks" on a specific cell in the worksheet;
*I do not want that a comment appears/disappears/ changes when the mouse moves over any of the cells
*I do want that the same comment/note is used to display different text when the user clicks on another cell in the worksheet
*I do want that the user can position this comment on his screen where he wants it to be.
I want to hide and unhide column AI by double clicking on a certain cell, let's say S25. Can this be done?
View 8 Replies View RelatedI have two pieces of code. The first one puts a tick mark in the cell when you double click it. The second one hides column B of another sheet if the value in cell A1 of Sheet1 is "a". I want to combine these two codes so that when I double click cell A1 of sheet1 it puts a tick mark in the cell and hides column B of Sheet2 and clears the contents of range B2:B50 of Sheet2.
View 4 Replies View RelatedI have one issue with my protected worksheet. Some locked cell contents are linked to cell contents located in another sheet. When I double clicked on these cells, a warning window poped up but also opened the sheet in which the corresponding cell is located. This is quite annoying to have to go back to the former sheet. How can I prevent it ?
View 3 Replies View RelatedI have code in my Worksheet_SelectionChange.
However it will not update until I physically click on any cell within the U33 to U38 range.
How do I tell Excel that I physically clicked on any of these cells? I have tried Activate..., blank and re-populate, select cell, select range... In VBA it does not think it is being clicked on.. it is just doing the code... when done I have to again manually/physically click on it.
I have created a workbook of 12 monthly worksheets, with an index page with hyperlinks to each worksheet. There is also a hyperlink on each worksheet to return to index page. Each worksheet is protected, but the cells which users can enter information are not locked. The protected worksheets have the 'select locked cells' unticked.
I have found that an inadvertant click on any of the protected cells in the worksheet will take users back to the index page. This is very annoying, what have I done wrong? The hyperlink is one of the unlocked cells.
I have a very long spreadsheet and want to keep it manageable by hiding rows until they are needed.
Example:
Column
Row A B C D E
1 Line1
2 Reg
3 OT
4 Min
5 Line2
6 Reg
7 OT
8 Min
I want to click on A1 and auto hide rows 2-4. Then I want to click on A1 and auto unhide rows 2-4. Then I would copy the idea to Line2, etc.
how to run some VBA code (written by someone else, unfortunately) only when clicking once in cell A1, and not run in any other cell. This is being run in Excel 2010. The code I would like to run in this manner is below, and currently will run when the user clicks on any cell in the worksheet it is applied.
[
Option Explicit_________________________________________
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'If IsDate(Target.Cells(1, 1).Value) Then
Set DatePickerForm.Target = Target.Cells(1, 1)
DatePickerForm.Show vbModal
Cancel = True
'End If
End Sub
]
I have a spreadsheet with 5 columns. A1 to A5
Entries are made into columns A2 to A5 but only ever one entry across all cells
If an entry is made into A2 to A5 the I need a "P" to be placed into A1
I am trying to create a macro which gives me an input box. I need to enter 2 numbers into the input box. It would be as follows:
Input Box Msg 1 - "What is your labor cost?" (NUM1)
Input Box Msg 2 - "What is your productivity rate?" (NUM2)
Then I need the macro to take this info and enter it into a formula which changes according to the row which you are on. (I need the macro to work based on which ever cell I currently have selected). The formula would be this if I currently had a cell on row 10 selected:
=(NUM1*(NUM2*$H10))/$H10
So, if I currently had cell L10 selected, and I ran the macro and put 100 in for "NUM1" and 10 for "NUM2" and my sheet had 20 in cell H10, then the macro would enter the number 1,000 into cell L10. If I had L500 selected, then the macro would enter the final number into cell L500 based on what value H500 contained.
I searched and I keep finding something that's not quite what I'm looking to do so I think I'm missing something really simple.
Let's say that I want each cell in col b to be the sum of 5 plus whatever value is in the cell adjacent to it on the left (col).
I know that you can just write a formula in each cell like...
b1 will be =sum(a1+5)
b2 will be =sum(a2+5)
... but is there a shortcut so that you don't have to write out the actual cell address for each one?
Meaning - is there a predefined name or something that represents the cell to the left or right so you can just use that instead, allowing you to just copy paste the same formula all the way down the column? Something like...
b1 will be =sum(left+5)
b2 will be =sum(left+5)
... where "left" represents whatever value is in the cell to the left of that particular cell?