Posts by Guidoa961

    Hi all,
    Situation: I click on the X at the upper right corner to close a folder; Excel automatically pops up a MsgBox asking if I want to save the changes. Four buttons are available, Save, Don't save, Cancel, Close pop up.
    Question: Is there a way to know what button the user has chosen? In a macro I would then do one thing or another depending on the button clicked.
    Thank you!

    I copied much of the following code, which determines if a filter is used, and it works! But I just can't figure out what the two statements pointed out by arrows do.
    In column L row 10 I have

    Code
    1. =FindFilterOn(L10)


    In a module there is:


    Please someone be so kind to explain to me in simple words the two statements. I'm a beginner. Thank You!!

    Hi all,
    Tough to understand title, sorry.
    I'd like to specify the character that goes into a variable only once instead writing it a number of times. Here's what I mean:
    StringVariable = ">>>>>>>>>>"
    Is there something like: StringVariable = 10">"
    With the latter, a programmer can specify the character only once instead writing it ten times.
    Thank you!


    An answer "no way" is still a useful answer; this way I know what I can and can't do.

    I'm not sure what you mean: when you click on gggg (cell B2) it doesn't do anthing? On my computer RRR links to and shows SSS.xlsx which is totally void of code or anything. Maybe when one downloads one has to redo the hyperlink path? Seems strange....don't know. :o2
    I attached the two files again; RRR includes the second version of Worksheet_SelectionChange. If you put an interruption point next to it you'll see it is not executed (at least it does so on my computer).
    Thank you Mumps!
    Guido.

    Files

    • RRR.xlsm

      (17.91 kB, downloaded 92 times, last: )
    • SSS.xlsx

      (7.84 kB, downloaded 90 times, last: )

    I just did what you did: I set up a new sheet with nothing in it but the code you gave me, a button and a cell which hyperlinks to a sheet in another file; it does't work. I realize I didn't mention the underlined words before, sorry; could it be the reason it doesn't work?
    What do you mean by 'De-sensitize the data'?
    Thank you for your patience; Im just a little above the beginner status.


    P.S. I attached the two files I just tested; I'm afraid they are in Italian. The format shouldn't be much different from English Excel but if you'd like a translation just ask.

    Files

    • RRR.xlsm

      (19.03 kB, downloaded 102 times, last: )

    Thank you Mumps, but the sub Worksheet_SelectionChange is not executed; To make sure I also put an interruption point at the left of it to see what it was doing but after I clicked on the hyperlink nothing happened and I went straight to Sheet2, on the contrary when I did the same for other events the execution stopped showing me the associated sub was being executed. Putting the sub in a Sheet or Module made no difference.
    Do you know why this happens?
    Thank you
    Guido

    Hi Tom,
    It works! Thank you! There's a strange behaviour:
    - the first time I open excelcoding_mouse_wheel_scroll.xlsm and scroll the page all is fine.
    - I close the file but it reopens automatically telling me:
    - Restore documents - Excel has restored the following files. Save the files you want. excelcoding.....scroll.xlsm is shown.
    - I close it again but, no matter if I save it or not, everytime I reopen it the same thing is shown.
    - I attached the screenshot which shows it (in Italian) because I can't find a way to put it in after the text. :oops:
    Do you know why this happens?
    Thank you
    Guido


    P.S. I made a donation to the American Cancer Society. Paypal Transaction ID is:

    [SIZE=12px]O-1B929149UR459291B[/SIZE]

    [TABLE="border: 0, cellpadding: 0, cellspacing: 0, width: 0"]

    [tr]


    [TD="align: right"] [/TD]
    [TD="width: 20, align: center"] [/TD]

    [/tr]


    [/TABLE]

    Hi all,
    In Sheet1 I have a cell where an Hyperlink links to Sheet2.
    I'd like to set the back color of an Activex control button to red in Sheet1, the same where I click on the Hyperlink, right after I click but before control is passed to Sheet2 so that, when I go back to Sheet1, the color of the button is red.
    Is there a way to do it by using an event, something like Worksheet_BeforeHyperlink, or maybe someone can suggest a workaround?


    Thank you!

    [SIZE=13px][SIZE=12px][SIZE=16px]Hi Tom,[/SIZE][/SIZE][/SIZE]


    [SIZE=13px][SIZE=12px][SIZE=16px]In the attached document you can find screenshots of which Window, Mouse, Office, Excel I have.[/SIZE][/SIZE][/SIZE]


    [SIZE=13px][SIZE=12px][SIZE=16px]The information in the screenshots is in Italian; I assume formatting is much the same in English. As a general rule take off the last 1-3 letters and you have the English word or much of it. Anyway, if you’d like to have a translation just ask.[/SIZE][/SIZE][/SIZE]


    [SIZE=12px][SIZE=16px]If the screenshots are of no help I have a few questions in order to come to a solution:[/SIZE][/SIZE]


    [SIZE=13px]1. A[/SIZE][SIZE=13px][SIZE=12px][SIZE=16px]re my labtop/mouse, [/SIZE][/SIZE][/SIZE][SIZE=16px]both bought in 2009,[/SIZE][SIZE=13px][SIZE=12px][SIZE=16px] too old?[/SIZE][/SIZE][/SIZE]


    [SIZE=13px][SIZE=12px][SIZE=16px]2. As you have seen, “Tipo sistema(System type) says I have Windows 10 32bit based on a 64bit processor; can it be a problem?[/SIZE][/SIZE][/SIZE]


    [SIZE=12px][SIZE=16px]3. Consider also that many times i had to shut the laptop down abruptly and remove the battery because Windows and/or Excel had stalled for several minutes. This might have left the laptop with ‘dirty’ stuff which hasn’t caused problems until now? If this is possible, should I buy a new ‘clean’ 64bit laptop with all 64bit software and hardware or keep the laptop I have and upgrade Windows 10 to 64bit and reinstal Excel?[/SIZE][/SIZE]


    [SIZE=13px][SIZE=12px][SIZE=16px]Thank you very much Tom for you time. By the way, please give me your paypal account or credit card number to send you the 45 bucks you earned.
    Have a nice Sunday.[/SIZE]
    [/SIZE]
    [/SIZE]


    [SIZE=13px][SIZE=12px][SIZE=16px]Guido[/SIZE][/SIZE][/SIZE]

    Hi Tom,
    Thank you for the code but I must be doing something wrong because neither the row counter cell nor the status bar are updated.
    Here is what I did:
    1. Downloaded excelcoding_mouse_wheel_scroll.
    2. Opened it; it is in protected view mode so in File/Information I enabled modifications. Then I enabled contents. No more messages from Excel.
    3. Clicked on the Mouse Wheel Scroll sheet.
    4. Clicked on the 'Mouse Wheel Activate' button which then shows 'Mouse Wheel Deactivate'; the message "Mouse Wheel Event Activated. Ensure....' is shown and I click ok.
    5. I scroll using the mouse wheel; the page scrolls but the counter in D2 shows zero and the status bar shows 'Mouse Wheel Rows Scrolled 0'.
    I ran the risk of crashing Excel and in View Code I put an interruption point in the module modMouseWheelScroll on the left of 'Public Sub MouseWheel...' then 'Private Function WindowProc...', got out of View Code, scrolled again but neither of them seem to be executed.
    I did the same for the worksheet wsMouseScroll on the left of 'Private Sub cmdMouseWheel_Click()' but when I clicked on the Mouse Wheel Activate/Deactivate button I entered the sub and could follow it line by line (F8).
    What is wrong Tom ?


    Guido

    This is not homework; I am 56. I program only for myself and the fun of it. I'm willing to pay if I can't do it on my own and can't find a solution in another way.


    I originally posted this help request, my first, on the free section of the site but haven't gotten any bites so I'm trying this out.


    This is my original post:
    I need to capture mouse wheel rotation steps in order to update a row counter in a cell of a sheet.
    I don't need to take complete control of the mouse (unless I have to), just read a parameter which tells me if the wheel has been moved up or down.
    I have Excel 2016 and Windows 10.
    Is it possible to do what I need? Does anyone have the VBA code to achieve it? (and a quick explanation of it, thanx)


    I was asked for more information, here it is:
    I'd like to be able to update a cell of a sheet where I have a row counter.
    By using Application.OnKey I already update that cell when the user presses PgUp/Dn and the Up/Down arrows by subtracting/adding 33 (it is the number of rows I show in a page) or 1 for the arrows. I'd like to do the same with the mouse wheel by adding or subtracting 3 (better yet the number in Settings/Mouse).
    I've seen code which lets the user scroll in a form but, because I'm a beginner, I understand little of that code therefore I can't change it.


    That's it.
    I'd add I have 32bit Windows 10 on a 64bit machine; one day I guess I'll upgrade to Windows 10 64 bit but for now....


    My requests, obiously except the code :-) :
    1. a comment to explain what each function/sub does.
    2. where the code has to be put (Sheet, Module, ThisWorkBook).
    3. changes to be made if I upgrade to 64bit Windows 10.
    4. how to start the code; if possible i'd like to enable and disable it (which is, return the wheel to its normal use) by pressing for example an ActiveX button.


    Any further info/clarification required please ask.
    Thank you!
    Guido

    Hi Dave,
    I'd like to be able to update a cell of a sheet where I have a row counter.
    By using Application.OnKey I already update that cell when the user presses PgUp/Dn and the Up/Down arrows by subtracting/adding 33 (it is the number of rows I show in a page) or 1 for the arrows. I'd like to do the same with the mouse wheel by adding or subtracting 3 (better yet the number in Settings/Mouse).
    I've seen some code which lets the user scroll in a form but, because I'm a beginner, I understand little of that code therefore I can't change it.
    Thank you Dave!


    Guido