Posts by Guyglk

    I'd like to run a macro that will tell the user if there is any type of animation set in the PowerPoint file.

    So far I have managed to detect animation only by looping through each shape in the presentation and using this:

    if shp.AnimationSettings.Animate then animCount=animCount+1

    But, for some reason motion paths animations are ignored. Any idea how I can catch them too?

    Need this macro to work in both ppt2007 and ppt2013.


    Hi, I'm working with VBA6 that should eventually run on office applications 2007 and 2013.

    Some background:
    I have written and dedigend for each (Word, Excel and PowerPoint) a VBA Userform. Each Userform is different (suited for the needs in each application). Each Userform also has a bunch of controls on it to set stuff before running.

    What I want is to have a preset option where the user can save the current settings of all of the Userform controls so that it is readily available to load their settings again instead of setting stuff every time. The settings may vary, so hard-coding presets isn't really effective.

    I'm asking your opinion for how it can be achieved, in theory (before I start getting my hands dirty with this) . I was thinking about using a standard excel file* (3 files in total. One for each Userform) as a place to store and load a preset. Does this sound like a good way to do that? I don't wanna overcomplicate things, just looking for an easy or at least the easiest way to make it happen.
    [SIZE=12px]*I'm already fairly familiar with how to 'talk' to excel sheets/cells and modify Userform controls accordingly depending on cells' values and such.[/SIZE]

    I'm interested to know what you guys think. Feasible (for an amateur-level-VBA-coder as myself..)? Too complicated (any easier/better way to approach this -- levelwise) (and why is it bad.. If you think it's a really bad way to go)?

    Thank you so much for any input!

    Hi there!
    I wanna write a vba (office 2007, 2013) that will let me know which cells (in a large sheet or in a range that i select) have similar font and fill color, because they appear empty but are not - and I need to know if they have a value or something in them. The formatting should stay the same so I can't just pick up all of the values or mess with their already defined colors... I need to sift through and find the ones that appear empty 'cause of same or similar font/interior color (to then evaluate if I need them or not.. not using vba but my own judgment.. :)

    Is there a way to compare colors, and detirmen if the two (fill vs font) are similer or very similer so I can pull their value out..or at least put them in a list (cell address or something) which know how to do.
    Identical colors are easy to figure out, so no problem there...



    Union indeed did the trick. I used it in order to add up to the current selection range, to select only the rows I need in one click.

    Where RW (row number) and shtName are extracted from the array of the strings and then using for loop ( with the piece I was missing):

    Set RNG = Sheets(shtName).Range(RW & ":" & RW)
        Union(Selection, RNG).Select

    Works perfectly.
    Thank you very much!

    (Using Office 2007) I want to programmatically select entire rows on command, sort of like adding to selection that's already selected in the sheet bit by bit, just like when a user can hold Alt and select whichever range, adding more cells/ranges to the selection. Can this be done via VBA?

    This is where I'm basically at:

    What I have is an array that already has the "rows" I would like to be selected in a particular sheet. The array is of strings that are basically telling what row needs to be selected (entire row) in which sheet (sheet name) .

    For instance, based on the following array of strings (where before the @ is the sheet name and after the @ is the row number to be selected:

    [email protected]
    [email protected]
    [email protected]
    [email protected]

    I would like to have the entire row of row 6 and 11 in Sheet1 selected, the entire row of row 4 in Sheet2 selected, and the entire row of row 6 in Sheet3 selected.

    I have already accomplished this by iterating through such an array using a for each loop where in each iteration I extract the row numbers and sheet names of each sheet from each string and rearrange them to other separate 'standalone' strings (called rwNums for rows and ShtName for the current sheet name) so they can be used to form a proper Range selection (i.e. "[email protected]" and "[email protected]" become rwNums that's actually "6:6, 11:11" ), and then I just plug this in Sheet(ShtName).Range(rwNums).EntireRow.Select

    This works really well until it hits the string length limit, I believe.... (when the array has to many rows/strings to concatenate), and the macro breaks. It prompts a Run-time error '1004'. Application-defined or object-defined error.

    I therefore would like to avoid using a string to build my "rows for selection" and go straight to something similar to Ctrl+ select in order to avoid any limitations, or simply being able to add smaller chuncks to a selection that has already been made, using much shorter strings...

    Is this possible?

    Maybe something like:

    With Selection
    .Add Sheet(ShtName).Range("6:6, 11:11").EntireRow.Select
    End With

    Hope this was clear..

    Any other suggestions of doing this?
    Thank you!


    I'd like to know if there are differences in the following ways that Excel allows to display text/string in cells (regarding VBA usage):
    To illustrate what I mean: let's say I have the string Example.
    Excel allows to display this string in several simple ways:

    1. Simply type in the string you want, in which both the value and the cell's text properties are one and the same ("Example").

    2. Type in an apostraphy proceeding your string, as in: 'Example, in which both the Value and Text properties of the cell are still pretty close
    (I suppose that here the cell's format is being explicity set to text in one strock, right?).

    3. Type in a formula that returns a fixed string, as in: ="Example" in which the Value and Text properties are more apparently different.

    And there is another way which is more dynamic (usign "non-self-returning" formulas as seen in 3), but this is not as relevant to my question as I focus on a rather fixed way of displaying a string.

    So other than the obvious differences I pointed out (Value vs Text), is there a difference in them?

    Thank you!