Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Excel


VBA: Recognise Mouse Click Event?

I ask because I would like to change the value of a cell within A:A to TODAY() if the user right clicks on it - or with some keyboard combination.

View Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Formula: Recognise When A Child Equalled Or Bettered A Club Record In An Event
I wrote a formula to recognise when a child equalled or bettered a club record (CR) in an event. However what I neglected to do and cannot work out is for the formula to recognise the new time as the new club record that will then have to be equalled or bettered from then on to be recognised as a club record. For example CR for 70 metres is 9.28 secs. Formula I was working with was IF(ISBLANK(B3),""),IF(B3

View Replies!   View Related
No Right Mouse Click
I use Excel XP 2002. I now can't copy /paste by using the right mouse button. It works perfectly in other MS products, on the net and on the desktop. l have checked my Tools/Options with other users, I have uninstalled, rebooted and reinstalled the complete Excel package but the problem persists, even from start with a blank worksheet. I have also checked and there are no add-on ticked.

View Replies!   View Related
Mouse Click Selection
I'm trying to design a form, for various staff members to populate.
I would like to ease their usage by putting a check mark in which ever cell they left click, also if they click a second time in the same cell it will undo the action.

I have not decided yet which which cells I am using, but is their some simple routine that could be used over & over again and all I would need to do would (hopefully) simply be to change the cell numbers in the routine to apply to that cell or range of cells.

View Replies!   View Related
Run Mouse Right Click Macro From Add-In
I have a large project that I've been able to move all code from the workbook to an Add-In (except code that's sheet related).

I have one module that refuses to run from the Add-In. In this code

View Replies!   View Related
Simulate A Mouse Click
I have a log that stores a list of different files in the first column. All of these files are worksheet hyperlinks (ie: =HYPERLINK("\USSS000010_PUBLIC5_COMMON15_PPA20066-032G6-032G.xls","06-032G")). If I click on any of these cells the file will open.

I am trying to open certain files from the list using VBA.

My question is Is there any way to simulate a mouse click, on the cell containing the hyperlink, using VBA?

View Replies!   View Related
Right Click Mouse Button On The Keyboard
For instance if I want to cut a row and column, how do I insert with the keyboard without pasting over other data

View Replies!   View Related
Add Date To Cell With A Right Mouse Click
I want to select a function from a right mouse click that will place the current date in the selected cell.


1) Click on a cell
2) Perform a right mouse click
3) select the date function
4) the current date appears in selected cell

could this be set up so that the date function in the right mouse click only appears when specified cells are selected? Is this doable?

View Replies!   View Related
Disable Some Right Mouse Click Options
way, using VBA code, to disable/enable individual shortcut menu items that are are made available with a right mouse button click. The following code disables the right mouse button completely but I would like to disable only a couple of options like the ' Cut' option.

The code to disable is below and to re-enable I just change False to True.

Dim cb As CommandBar
i = 0
For Each cb In CommandBars
If cb.Type = msoBarTypePopup Then cb.Enabled = False
Next cb

View Replies!   View Related
Mouse Macro (right Click Not Working)
my right mouse-clicker doesn't work in excel anymore. something with macros happened I guess.

has anybody an idea to activate it again?? it's just in the workfield, to change worksheets-colours and stuff at the worksheet-registry it works as usual.

it's very nasty to work in cells without mouse..

View Replies!   View Related
Listbox Pop Up Menu On Mouse Right Click
I have a list box with items. When I stay on item and press mouse right click, I want see pop up menu with "remove this item" and "add new item".

View Replies!   View Related
Place A Checkmark With A Single Mouse Click?
I have a worksheet that I use to monitor the progress of student interns. They are assigned 20 different tasks and recieve 5 points for each task they complete, for a possible total of 100. In my worksheet, I record their progress and maintain a running total. I do this by simply inserting the number "5" by each cell containing each task. Instead of inserting the value, what I'd prefer to do is simply place my cursor, click the mouse button, and have a formattable check mark appear with a hidden value of "5". I'm simply trying to create a snazzy interface. Do I want too much? Or is it actually possible to do this?

View Replies!   View Related
Close/Open Userforms On Mouse Click
I have a menu structure in place so when a user clicks a button, it opens a Userform as a menu. The only problem i have is that if the user doesnt want to use that menu, and clicks on the spreadsheet, it doesnt dissapear.

Is there any VBA code that anyone knows that when a user clicks on the spreadsheet, or even just clicks their mouse anywhere (ie other menus at the top, spreadsheet, desktop) like a mouseout code on HTML so the menu will dissapear?

View Replies!   View Related
Using Double-click On Mouse To Perform An Action?
I have an excel file with a column (I) which lists the total number of businesses in a different tab (DATA) that meet certain restrictions (these restrictions being listed in the same row in different cells). When the cell under coluimn "I" is double-clicked, it pulls the businesses from tab DATA that meet the restrictions for that row and shows them all in another tab.

I don't know the person that created this and was wondering if there is a way to figure out what is being done to make this happen? I looked in macros, but didn't see anything relating to this. Anyone know how this is done?

So you know, I have tried double-clicking other cells, but nothing happens - not even editing into the cell (altho this can be done from the toolbar up top).

View Replies!   View Related
Show User Form Value With Mouse Over Event
it is possible to add a mouse over event to this Macro so that when a user runs the mouse over the bitmap picture that this macro is assigned to it would show the value in TextBox7 for the record with the specified TextBox1 Value.

For example for the below Macro it would show the Value of TextBox7 for the record that matches "103" in TextBox1

I have searched the Forum as well as a few different VBA books and can not find much on Mouse Over events

Sub crkt_id_103()
Load frmMain
frmMain.TextBox1 = "103"
End Sub

View Replies!   View Related
Mouse Click Freezes Screen - Code Still Executes
it would be possible to have text disappear after being displayed in Excel for a while.

My son and I played around with games (helping create a photographic memory, I told the youngster!) on the thing and until yesterday neither of us noticed that clicking the mouse anywhere (actually just clicking it) causes the screen to "freeze" while the code still happily erases the text in the background.

Hitting ESC allows the screen to cath up to the actual code EVEN THOUGH the ESC key is actually disabled from breaking the code.

View Replies!   View Related
Prevent Mouse Click From Affecting Ado Data Transfer
I'm using code based on the following post: Add Borders To Cells Of Spreadsheet From Access. That code was developed for a relatively small recordest. I am using the same coding style to transfer a recordset that has roughly 2000 records in it. Since this is all taking place over a network there is a period of time (about 15-20 seconds) where Excel is open and the user is watching the cells get populated from Access. If, during that period of time when Excel is open, the user clicks in a cell during the population of data, it stops the process and causes an error on the Access end (Error 50290: Application-defined or object-defined error). Is there a way I can prevent user input (perhaps prevent signals from the keyboard and mouse) until after the data has been transferred? I know this is a long way to do a TransferSpreadsheet command but I like the way the column headers get formatted as well as the column sizes. I also think it's pretty cool to watch the data populate as it goes.

View Replies!   View Related
Double Click Event
I am trying to write some questions on cells of Sheet1 of a workbook. Then I want to write the answers on cells of Sheet2 of the same workbook. I want the user to be able to double click the question-cell on Sheet1 and be taken to the respective answer on Sheet2.

View Replies!   View Related
Cell Click Event
How do I run code if I click on a cell in the workbook, like Cell A1 of Sheet1?

So far I just have...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)


End Sub

View Replies!   View Related
Click On Cell Event
1. I would like to trigger an event once i click on a cell, for example I click one click on a cell (1,1) and it run some macro.

2. When I bring my cursor to this cell, to change cursor pointer to pointer like in hyperlink.

View Replies!   View Related
Copy And Round With Click Event
I use a CommandButton on a UserForm to copy the contents of 12 TextBoxes into the last row on a sheet. I am getting numbers with too many places. I tried to use Round(), but it is not working.

Here is the original With Range("A65536").End(xlUp)
For i = 1 To 12
.Offset(0, i).Value = Me.Controls("TB" & i + 4).Value
Next i
End With

This gives me all of the decimal places.

Here is my attempt to use Round():
With Range("A65536").End(xlUp)
For i = 1 To 12
.Offset(0, i).Value = Round(Me.Controls("TB" & i + 4).Value)
Next i
End With

This gives me a type mismatch error.

View Replies!   View Related
Looping Within Double Click Event
I would like to create a macro in which, when the user double clicks on a cell, that cell will be shaded yellow and other cells within the Workbook containing the same value as that cell will be crossed out. I have come up with the below code, but it doesn't work correctly. Any ideas on what I have done wrong? Would also like it to not cross out the cell the user double clicked on.

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)

Dim wk As Worksheet
Dim selectedName As String
selectedName = ActiveCell.Value

With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With

For Each wk In ActiveWorkbook.Worksheets

For i = 200 To 2 Step -1
If ActiveSheet.Cells(i, 2).Value = selectedName Then
ActiveSheet.Cells(i, 2).Font.Strikethrough = True
End If
End Sub

View Replies!   View Related
Command Button Click Event
I have a UserForm with 2 command buttons.

The first Command Button ( called CommandButton22 ) displays the result of some other calculation as its Caption ... this caption will therefore be changing from time to time.

I would like the second Command Button (called EnterButton ), when clicked, to send the caption from CommandButton22 to whatever cell on the active spreadsheet the user clicked into just prior to clicking on the 'EnterButton'.

I would like each time that I click on the 'EnterButton' for the Caption in CommandButton22 to be sent to the next cell down and so on and so on etc.

View Replies!   View Related
On Row Click Event Show Dropdown In The Row
I have some rows in my sheet locked and some unlocked rows. When user clicks on a unlocked row I should be able to enter some information. I am suppose to populate some dropdowns in that row for him to choose. How can this be done??

I know when a user clicks a row worksheet change event is call. I can write a function in the worksheet change event to populate values in the dropdown. I went through some articles, and they say it can be done by hiding and unhiding rows.

View Replies!   View Related
Using Enter Key To Trigger Click Event
I am working with a large legacy file/program which has a lot of issues. Foremost, and unfortunately this cannot be changed, is that all of the controls were placed directly on the worksheets instead of on Userforms.

I had previously posted code from the legacy file which may have been excessively complicated. So I edited my post to this simple example. Sheet1 has one textbox and one command button. Sheet 2 is blank.

If Sheet2.Activate is commented, everything works fine. If Sheet2.Activate is executed, then Excel crashes....

View Replies!   View Related
Cell Click Event Open The Form
Is there a way that when a cell is clicked in a worksheet. that I can get a user form to open?

View Replies!   View Related
Copy A Cell With Duble Click Event
what im trying to do is to copy only the last 7 characters in column A:A
when i dubleclick on a cell.

if i click on a cell that has "8peu99s8a" i want it to copy only "eu99s8a" wich is the last 7 characters, and then i will past the data to another program i use.
this code will only apply for any cell in column A:A

View Replies!   View Related
Enter Key To Trigger CommandButton Click Event
I am working with a large legacy file/program which has a lot of issues. Foremost, and unfortunately this cannot be changed, is that all of the controls were placed directly on the worksheets instead of on Userforms. The actual code from the legacy file is excessively complicated, so I created this simple example. Sheet1 has one textbox and one command button. Sheet 2 is blank. I want to be able to click the command button or use the Enter key on the command button, to trigger the Click Event. Clicking works fine. When using Enter, if Sheet2.Activate is commented, everything works fine. If Sheet2.Activate is executed, then Excel crashes.

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim bBackwards As Boolean
Select Case KeyCode
'Only look for tab, return, down arrow, up arrow
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application. ScreenUpdating = False
'Do we need to go back to previous control
bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp)
If bBackwards Then TextBox1.Activate Else CommandButton1.Activate
Application.ScreenUpdating = True
End Select
End Sub
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim bBackwards, bForwards As Boolean
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False...................

View Replies!   View Related
Listbox Click Event Apparently Called Without Clicking
I am writing an application in Excel 2007 VBA (on Windows Vista) which presents the user with a series of 3 userforms, each containing a listbox. The user clicks on an item in the list box of the first form and then I use the listbox click event to process the answer and assemble the list items for the listbox in the second form. This sequence is repeated in the second form (user clicks item in listbox, click event processed and used to generate 3rd userform/listbox). This seemed to work fine at first but now in some cases after clicking an item in the first listbox, I am presented with the third listbox. Apparently a choice was made in the second list box and the third list box created based on that choice but I never was presented with the second userform/listbox.

I don't think it is related to the mechanics of clicking the mouse because it occurs repeatably as follows: I had a list (for listbox 2) that was 3 items long and everything was working. I added a fourth item. Now it consistently chooses the 3rd item in this list without ever presenting me the userform/listbox 2. If I remove the fourth item it presents me with userform/listbox 2 and I click on an item and everything works as intended.

The code for the second listbox callback is very short and simple:

Private Sub SecondListBox_Click()

Dim choice As String

choice = SecondListBox.Value
Unload Me
MakeThirdListBox (choice)

End Sub

View Replies!   View Related
Before Double Click Event Procedure For Multiple Sheets
I have a calendar userform set as Userform1 and I would like it to pop up upon double clicking in two different ranges 'date' which is on sheet 1 and 'dates' which is on sheet 4.

So far I have this code in Thisworkbook, which works perfectly for Sheet 1, but I get the following error on Sheet 4: Run time error '1004': Methed 'intersect of object'_global' failed.

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Sheet1.Range("date")) Is Nothing Then Exit Sub
Exit Sub
If Intersect(taregt, Sheet4.Range("date2")) Is Nothing Then Exit Sub
UserForm1.Show .............................

View Replies!   View Related
Before Double Click Event Of Worksheet Created By Program
My program(which is an add-in, or will be when I've finished writing it) creates a new worksheet called "Groups Summary" I would like this sheet to be locked so that the user can not modify anything on it. I would also like that if they double click a cell this will launch a userform if based on certain conditions.

I believe this code would have to go in the worksheet itself, so the question is how do I get the macro to enter code into a worksheet that it creates?

Is there a way to write it in a standard module and then automatically copy it when the worksheet is created?

View Replies!   View Related
2007 - Color Palette From A Button Click Event
Need a method for launching the color palette from a Button Click event so that the palette opens, the palette may be used to set a color, then have the color palette return the Long INT color value to the calling click event routine?

View Replies!   View Related
Textbox Click Stops Event Code Running
I have a textbox from the drawing toolbar. When someone changes a cell then clicks in the textbox, Worksheet_Change does not run. If they double click in the cell, that's OK I can capture that event and protect the sheet, stopping them clicking in it. But if they just start typing in the cell, I can't capture that. I have seen some API code which captures keypresses, but it is not practical to use as it loops repeatedly. I could lock the textbox and have the user do something to unlock it, but this is a last resort.

View Replies!   View Related
Catch The Click Event On "Increase Indent" Command Bar Button
I want to catch the click event on "Increase Indent" commandbar button.

I have this reference-

But not able to execute properly:

Till now I have generated below
Class Module "clsCBEvents"
Public WithEvents colCBars As Office.CommandBars
Public WithEvents cmdDecreseEndent As Office.CommandBarButton

Private Sub cmdDecreseEndent_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)

MsgBox "Hi"

End Sub.............

View Replies!   View Related
VBA Doesn't Recognise Selection
I have a report that has been running in it's current state for several months with no issue. However, today it has decided that it doesn't understand the word 'selection'.

eg: selection.copy gives compile error.

Now... obviously NOT USING selection is preferred. However, let's put that aside for now because there are LOTS of these in this report and it's never had an issue until today.

Is there some setting that could have gotten changed or something?

It's happening on multiple computers and we're running Excel 2003 (standard) with SP3.

View Replies!   View Related
VBA To Recognise If A Certain Report Is Already Open
How can I get VBA to recognise if a certain report is already open?

Basically, what I want to do is if the report is open then just copy the sheet across else if the report is not open the open the rpeort and copy the sheet across.

I'm only struggling with the first part, I can get it copying over fine but its the "if the report is already open" part I can't get my head around...

View Replies!   View Related
Countif To Recognise Different Text
I am using countif to count a range of cells D10:D34 returning a PB as a result of a formula in Col D.

The countif formula (=Countif(D10:D34,"PB") is in cell D39 and the result in D39 populates a cell in another worksheet. The formula in Col D also returns =PB results. I have placed another Countif formula in cell D41 (result to also populate a cell in another worksheet) to count all =PB's using (=Countif(D10:D34,"=PB"). The second countif doesn't work correctly. It counts all PB's and =PB's.

View Replies!   View Related
Recognise 011007 As Date?
I have a list of data with a column of dates in the format ddmmyy, that I'm trying to get Excel to recognise as dates. What's the best/easiest way to do this? I've tried text->columns then concatenating back together with dashes or periods in between (like normal date format), but Excel doesn't recognise it as dates...

View Replies!   View Related
Recognise A Blank Cell Within IF Function
How can i return a blank cell if the formula is looking at a blank cell with IF function?

E.g. IF(A1=" "," "," ")

(This is part of a bigger statement which returns a date if and when there is a date in the cell, if there isn't it comes up with an answer even though it should be blank)

View Replies!   View Related
Macro To Recognise No. Of Rows After Deletion
In my attachment, I had try to create a PO system that will show a dialouge box and capture input data of the dialogue box into the worksheet.

However, I am not able to make the macro recognise any manual deletion from the worksheet (e.g. delete any row in between the full data). Hence, when I input new data, the row will start from the last register counting of rows (i.e. Range("g1") in my attachment.) and it will leave a blank row after the last row of data and so on...

I will also like to know if I need to fix the "date" input to select from a "calendar" pop-up and input the date format into (e.g. year into column a, month into column b and day into column c) 3 separate columns. Is it possible?

View Replies!   View Related
AND Function Not Recognise The Named Range
In the formula below the AND function cannot recognise the named range "KolomFFundering". I need the named range because when I insert a row the range must also change. Is there any way to rewrite this formula without losing it's function? The range of "KolomFFundering" is F13:F23.

=IF(AND(J12<>"";KolomFFundering<>"");"verwijder getal uit kolom 'hoeveelheid'";IF(KolomFFundering<>"";SUM(KolomFFundering);IF(P12<>"";P12/L$227;"")))

View Replies!   View Related
Trying To Get SUMIF To Recognise Text Within A Cell
I'm trying to make a spreadsheet to organise my bank statements. I have raw data from online banking and I want to sum all the transactions that have "SAINSBURYS" in, for instance. I am using SUMIF to add the totals only if "SAINSBURYS" on the totals page matches "SAINSBURYS" on the raw data page. The problem I'm having is that the raw data cell doesnt just display "SAINSBURYS" but "SAINSBURYS LONGWATER BCG 12345678" for example, and so i cant find a way for SUMIF to recognise that it contains "SAINSBURYS".

View Replies!   View Related
Getting Graph To Recognise Date From Formula
whenever I select a series of dates for a line graph x axis Excel does not recognise the values as dates for the purposes of the scale tab in graph options. I suspect it may be because the dates are the result of formula in the relevant cells.

View Replies!   View Related
Vlookup, Can't Recognise: Cut Data From Paste Sheet
I can't figure out why I can't get values in D column, sheet1. Table array is on sheet4. (Ignore Error in column E... I just cut data from paste sheet because it was too large). Also, can't figure why is so huge :-S But that's not problem right now...

View Replies!   View Related
Worksheet Change Event :: (ByVal Target As Range) Event In Module After Creating A Sheet
Is there a way to write a Worksheet_SelectionChange (ByVal Target As Range) event in module after creating a sheet in VBA? I constantly delete a sheet, then repopulate it with a new one that is empty, but I need to add some code that happens if they should change a particular cell. It worked when I ran it on a worksheet without refreshing, but as soon as I cleared and repopulated the sheet, it was gone. Is there a way to preserve this?

View Replies!   View Related
Change Event Causing Event To Fire Again
I have the following code, which works perfectly:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim TotalDays As Integer

TotalDays = Range("C65536").End(xlUp).Row + 1

The code points to the next blank cell so the user can input a value. Each time the user enters a value I want to re-run the code so that the colour of the cell changes.

However I also want to perform various calculations on the sheet. However this means the sheet is being changed and so continually repeats my code.

How do I add the following, to my previous code?

Range("E8").Value = Cells(7, 6) * 2.5

View Replies!   View Related
I have a data base of hundreds of drawings all linked in Excel. In excel I just clik on the Hyperlinked file and it opens up in my cad program.

With so many files, in order to see exactly what I am opening I have to open it. This is just if the description is not clear.

Can I create a mouse over preview that would pop up a linked picture file or a jpg in an assigned box or free floating.

so when the user puts their mouse over the hyperlink number, without clicking it, a preview picture of the item will pop up right in the excel sheet.

View Replies!   View Related
Picture On Mouse Over
Is there a way to have a picture set to a cell so when you put your mouse on it it will popup like the comments do.

View Replies!   View Related
Mouse Over In Other Non VBA Application
Is it possible to get mouseover information from outside of Excel using VBA? I'm trying to automate a non-microsoft package but I need my mouseclicks to wait for a message to appear within the other application before my macro continues. I've already asked something similar before but I've put a better title on this thread so apologies for the repeat.

View Replies!   View Related
Disable Mouse
Is it possible prevent the use mouse (disable mouse) while a macro is running? I made a program which starts with animation of Shapes. If you click on shape while macro is running it stops animation.

View Replies!   View Related
Pop-up Graph On Mouse Over
is it posable to get a graph to popup when the mouse is draded over a certen cell? or maybe to get it to popup in the comments bubble. if that is possible. then is it possible to set pramators that if its above 350 it turns red( on a line graph) and if its below its turns black. this was throwen at my about 20 min ago.

View Replies!   View Related
Copyright 2005-08, All rights reserved