Posts by jdhill

    Re: Scroll through images on userform (Previous and Next cmdButtons)


    I'm back for help. As I mentioned in my opening post. My userform uses a multipage control. I have five tabs, each containing a "Previous" and "Next" command button. The code you provided works great with images loaded into one tab. As soon as I add a second tab with images and two more buttons, things go haywire. Is there a way to segregate the VBA running in one tab from affecting code running in the other tabs?

    All,


    I have a multipage userform in which I will be loading different images into on a weekly basis. I found some code at http://excel.bigresource.com/Track/excel-lI6GLu9s/ from user MickG that will scroll through images in the userform with "Previous" and "Next" command buttons. The problem I am having is that sometimes when I run the form the images will not appear and the buttons do not always display an image. Another problem that I am encountering is that when I switch tabs on the multipage control an image will not be displayed until I push the "Previous" or "Next" command buttons (sometimes several times).


    Could someone please help me clean up the code or suggest an alternate solution?


    Here is the code I am using:



    I am currently using Excel 2010 but will need the userform to work in Excel 2007.


    Thanks in advance,


    jdhill

    I have a simple spreadsheet to help track a budget. I have a chart that shows the total budget versus the budget spent (from cells A8 and A10 respectively). I also have two cells set up that calculate the percentage of the fiscal year gone (B8) and the percentage of the total budget spent (B10). What I need to do is have the budget spent column in the chart turn red if the percentage of the total budget spent is greater than the percentage of the fiscal year passed (IF(B8>B10, "turn the column red")). I've read several tutorials on conditionally formatting charts but haven't found an example that fits my situation. My condition (percentage of total budget spent vs percentage of fiscal year gone) are not part of the actual data series being plotted. I'm thinking, if this is even possible, that VBA will have to be used. If someone could please point me in the right direction I would greatly appreciate it.
    Thanks in advance.

    Re: VBA Macro Run-time error '1004 No cells found


    It appears that I have found my problem . I had my range set as ("A3:G") when the data was actually starting in ("A2"). This leads me to my next problem. The reason it was throwing the error was because the macro was looking for cost center 6913 which was located in cell A2 it wasn't found so the macro stopped.
    What I need to do now is create an IF THEN statement. The macro looks for a given cost center and moves that data to a worksheet titled by the cost center. If the worksheet doesn't contain a cost center it needs to move on to the next cost center, etc.
    I need help with the syntax


    For example
    If Range ("A2:G") 'contains cost center 6913 Then
    execute code
    Else
    move on to the next block of code


    Is this even possible with this type of routine?


    Again, thanks for any help/suggestions,


    jd


    I have a macro that I found and modified from "Mr. Alpha Frog" at MrExcel.com. The macro filters the data by cost center and sends the filtered data to the appropriate worksheet. I am receiving run-time error 1004: No cells found.
    I tested the macro in another spreadsheet and things worked great, but moving the macro to my actual worksheet creates problems. . When I push the macro button the main worksheet where data is found is rolled up into a filter and the populated columns are no longer visible which is where the error is thrown. I have included a comment at the error point.
    I have attached a copy of the spreadsheet and would greatly appreciate any help. If viewing the attached spreadsheet, to view the macro button you'll have to select the filter on the cost center column and "select all".


    Thanks in advance.


    jdhill


    VBA Macro Run-time error '1004 No cells found


    I have a macro that I found and modified from "Mr. Alpha Frog" at MrExcel.com. The macro filters the data by cost center and sends the filtered data to the appropriate worksheet. I am receiving run-time error 1004: No cells found.
    I tested the macro in another spreadsheet and things worked great, but moving the macro to my actual worksheet creates problems. . When I push the macro button the main worksheet where data is found is rolled up into a filter and the populated columns are no longer visible which is where the error is thrown. I have included a comment at the error point.
    I have attached a copy of the spreadsheet and would greatly appreciate any help. If viewing the attached spreadsheet, to view the macro button you'll have to select the filter on the cost center column and "select all".


    Thanks in advance.


    jdhill


    Re: Conditional VBA Macro to copy and paste range of cells from one worksheet to anot


    Hi Richie,I really appreciate you taking the time to give me a hand with my problem. I apologize for not being clearer with my explanation, this is my first attempt ever at creating a macro. Basically what I need to do is have the macro look at my "Purchased Items" worksheet and copy and paste those items to the corresponding cost center worksheet.
    [TABLE="class: grid, width: 500"]

    [tr]


    [td]

    Item

    [/td]


    [td]

    Cost Center

    [/td]


    [td]

    Price

    [/td]


    [td][/td]


    [td]

    Item

    [/td]


    [td]

    Cost Center

    [/td]


    [td]

    Price

    [/td]


    [/tr]


    [tr]


    [td]

    Gloves

    [/td]


    [td]

    6911

    [/td]


    [td]

    10.00

    [/td]


    [td][/td]


    [td]

    Scotch Brite

    [/td]


    [td]

    6916

    [/td]


    [td]

    5.00

    [/td]


    [/tr]


    [tr]


    [td]

    Dust Mask

    [/td]


    [td]

    6912

    [/td]


    [td]

    20.00

    [/td]


    [td][/td]


    [td]

    Desiccant

    [/td]


    [td]

    6914

    [/td]


    [td]

    2.50

    [/td]


    [/tr]


    [/TABLE]


    My real need is for the macro to push each range of cells to the appropriate work sheet. For example The order in red writing (Gloves, 6911, 10.00) would need to be sent to a new worksheet titled "6911".


    I know I am rambling but using the above table as an example I want cells A1:C1 to go to worksheet "6911", cells E4:G4 to go to worksheet "6914". The macro has to be dynamic as the "Purchased Items" page will change from day to day.


    Thanks again for your time and help, I do appreciate it very much.


    jdhill

    I am trying to set up a spreadsheet to help track a budget. The worksheet titled "Purchased Items" will be filled out daily (and erased the next day for more orders) by those placing orders. My organization is divided up into separate cost centers with each having an allotted budget. I am wanting to track that annual budget by cost center in individual worksheets. I am trying to create a macro that can pull those rows with items purchased by a cost center to be moved to the appropriate worksheet. There are 3 types of orders that can be placed; "Regular", "Special", and "Emergency". On row 3, three different cost centers could have an order placed in each order type. I need the macro to only look at the range that meets the condition to be copied and pasted into the appropriate worksheet (e.g. cells A3:E3 need to be pasted into worksheet 6911 cells A3:E3. Each additional entry would be added to the next available row. Below is the macro I am attempting to make work:


    How do I limit what is copied and pasted? This macro is pasting everything into the specified worksheet if it finds "6911" in any cell.


    Thanks in advance for any suggestions.


    Regards,


    Josh