Posts by turbonate

    I have several bubble plots which I'm using the bubble size to show one of three strategic scores. In many cases the score for the Z-Axis (size) will be Zero, so that point doesn't show up on the chart. How can I set the Z-Axis scale of a bubble plot to show Zero's as the smallest bubble size rather than one's as the smallest bubble size?


    I've tried this approach: http://peltiertech.com/Excel/Charts/ControlBubbleSizes.html
    with the smallest value being -1 or -5. Didn't work.


    Using Excel 2013, Windows 7.

    Re: Go to other cell based on matching values using button control


    Using the two find Methods listed on Ozgrid you can add this code to the button sub.


    Find method reference: http://www.ozgrid.com/VBA/find-method.htm
    Find Date reference: http://www.ozgrid.com/VBA/find-dates.htm



    Limitations: this code assumes that the sheet which you are editing will always be active while it is executing. We'd have to add more references to update it.


    cheers!
    Nate

    Re: Running Multiple Macros on Different Cell Changes


    you could also pass the target range to the sub:



    You might try AAE's suggestion as I didn't look up the AutoFilter function, I'm just suggesting another way to reference the cell you're working with. It might make more sense to pass the Target to the AutoResize() sub than the AutoFilter() sub. What you have will work, it's just a matter of if one of these ideas will work better.

    Re: Running Multiple Macros on Different Cell Changes


    Hi SF007,


    will this work?


    There is only one Worksheet_Change event which is triggered when a change occurs. You already captured the event that you want for AutoResize and for AutoFilter so there's no reason to have another event sub. You have the right structure already set up with a Case structure so you just need to add another Case which triggers the AutoFilter event. You were so close already!


    Also, there is no such thing as Worksheet_Change1() event.


    cheers!

    Re: file system object error, trying to index a file list object


    OK, so this function works, but it crashes excel due to the slow speed of the loop in each use of the function. (think folder with 200 files) this would be around 30,000 executions.


    Since it is a function it runs each time excel decides to update sheets. We are violating one of the Golden Rules (Don't write functions/sheets that require xlCalculationManual).


    I'm trying to think of a faster way to do this, is there some sort of replacement or workaround for indexing in the files collection?

    Re: file system object error, trying to index a file list object


    Hi Jindon!


    That makes sense with what I am seeing in the locals window while running this script. Instead of an object with indexes I'm seeing separate entries name "item 1" "item 2" etc. It seems so close but yet so far.


    Also, this is supposed to be a function but I modified the code to be a sub so that the built in error trapping and debug features work. This is my final code:



    cheers!
    Nate

    Hey gurus,


    I'm trying to make a function which will allow me to input a folder and an index in a sheet to quickly list files in my worksheet. I think my error has to do with not understanding the file system object but that's about as far as I can figure. I've modified my code to be a sub so that the error trapping works, I tried to comment and explain where the code will be modified back into a function once I figure out this error.


    My code throws a runtime error 5: invalid procedure call or argument on myFiles(index).


    here's my code:



    cheers!
    Nate

    Re: Highligh a cell on same row as active.cell whenever active.cell changes


    Try using the worksheet_selectionChange event like this:



    cheers!
    Nate

    Re: OnKey gives all capital letters?


    rory, thank you for the clarification. Glad to know it's a "feature", not a bug.


    royUK, the point of my code is a bit beyond what I want to explain right now. I'll find a workaround for this section, if and when I get stuck I'll post again. I just don't want to use up valuable Guru time for sections that I know I can figure out myself. :D I really appreciate the willingness of people on this forum to help and I don't want to abuse their time.


    cheers!

    Hey gurus,
    I'm trying to use Application.OnKey commands for upper and lower case letters, but it seems like Excel always uses upper case letters (chars 65 to 90) rather than using lower case letters (chars 97 to 122).

    To be more specific: When I activate OnKey calls for all letters (65:90 and 97:122) and I press a lower case letter such as "e" I should get the character number 101, but instead I get the character number 69.


    Can anyone shed some light on this?


    Re: It's possible to create an "autorization" workbook with excel?


    I made a system like this before but don't have any of the code anymore. :sad:


    My system assumes a shared file drive which all people are working on. After an engineer creates a Work Order the Work Order sheet is saved in a "ToBeApproved" folder on the shared drive and an email sent to the supervisor. When the supervisor gets the email s/he can open the file and press "Approved" or "Rejected". When the sheet is approved it is moved to another folder "ApprovedWorkOrders". If the "Rejected" button is pressed the sheet creates another email reply to the engineer which says the Work Order was rejected and leaves space for the supervisor to finish the email with reasons why.


    Would a system like this work for you? If so what parts of the coding do you need help with?


    cheers!
    Nate

    Hey gurus,


    I found this: VBA Golden Rules #19: Use Named Ranges Over Cell Addresses. here: http://www.ozgrid.com/forum/showthread.php?t=76234


    I'm guessing that means the .cells function is a subroutine of the .range function. Therefore


    Code
    dim iRow as integer 'row indexiRow = 3with mySheet  .Range("B" & iRow)end with 'mySheet


    should be faster than


    Code
    dim iRow as integer 'row indexiRow = 3with mySheet  .cells(iRow , 2)end with


    The string operator ("B" & iRow) to get the named range function seems like it would take longer than using the numerical references in .cells().


    Thanks!
    Nate

    Re: Get worksheet buttons to execute code stored in an add-in module


    I found an answer to this question myself eventually. By creating a worksheet control button via VBA it is possible to set the .OnAction parameter to a script which is in the add-in rather than using the button1_click() event in the worksheet. See my code bellow which checks if the button exists and then creates the button with the correct link if the button does not exist.



    Cheers!
    Nate

    Hey gurus,


    I've read in a few places that it is possible to use up to FOUR buttons in the msgbox API. I am trying to figure out how to use that fourth button but I don't see how to do the sum value for the "buttons" argument in the function call. I'm trying to use the vbYesNoCancel with an additional vbIgnore button option.


    here's my code and what I'm trying to do:



    I can make a user form if needed, but I want to know if this fictitious fourth button is usable before I go through the trouble.


    cheers!
    Nate

    Is there any way to do this part of code without calling out each element individually?:



    I know how to use the array() function to program multiple elements of a variant as a single dimension array, but I'd like to be more explicit and I'm not sure how to do it in two dimensions. This kind of array programming is easy in languages like Matlab etc, but there must be some easy way to do it in VBA.


    In Matlab this would look something like this:

    Code
    aSequence = [ 
    -1, 0, 1, 1, 1, 0, -1, -1;
    1, 1, 1, 0, -1, -1, -1, 0;
    ]


    [TABLE="width: 40"]

    [tr]


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

    [/tr]


    [/TABLE]
    Nate

    Re: Get worksheet buttons to execute code stored in an add-in module


    Venkat, that would work but I'm trying to do this without a macro in the data sheet. I would like to only have code in the addin and not have to write any links in the data sheets.


    Is this possible?


    example: I have a "doIt" button in data123.xlsx as well as data456.xlsx and any variation of file names
    I have and addin called myAddin with subs mySetup() and myDoIt() etc.
    I'd like to have the code in mySetup() link to the button "doIt" if it exists in any of the data sheets (data123.xlsx or data345.xlsx)


    does my trivial example help?


    thanks for the reply!
    Nate