Consulting

Results 1 to 5 of 5

Thread: Adjusting VBA module

  1. #1

    Adjusting VBA module

    Hi All
    I have raw data that I convert into a format I can upload into my accounting program.

    I have a xlsm file with 7 modules or so. One of these modules calculates discount. It takes the price in the raw data and compares it to a price listed on a xlsx file. If that price is lower it will calculate the discount them make a new discount line with that value. We are changing our prices for some of the customers. It is going up of course. Since it is only changing for some customers it is causing a problem. Currently if the price in the raw data sold price is more than the price of the item “price listed in xlsx file” it replaces the higher price with the correct price. Since that price increase, I need a change I was hoping someone can help me with. If the price is higher than the correct price “listed in the xlsx file” I now need it to leave that price alone. “Not change it to match the correct price”. Would anyone have time to take a look and see if it is just a quick fix.

    I have two xlsm files. One for credits and one for invoices. I need the same done to both.
    I have attached both xlsm files I use to convert the data, the xlsx files the xlsm use to do conversion and a file showing raw data, current conversion and how I need the conversion outcome to look.
    Attached Files Attached Files

  2. #2
    I have figured out how to fix the problem I explained in the first post. Now I need help with another.
    The xlsm file needs a module that will remove lines. I will have an excel file attached that shows if the invoices have been signed. There is a column for signature status. I need all invoices with a false for signature to be removed when I do the converting with the xlsm file. I have attached the file I will get each week that shows signature status.
    If a module could find all invoice numbers with a false under signature and remove them when using the invoice xlsm file to do the converting.
    Attached Files Attached Files

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    Try

    Sub Macro1()
        With ActiveSheet.Columns(4)
            .Replace What:="FALSE", Replacement:="=1/0", LookAt:=xlPart, _
                SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
                ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
            On Error Resume Next
            .SpecialCells(xlCellTypeFormulas, 16).EntireRow.Delete
            On Error GoTo 0
        End With
    End Sub
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #4
    Thanks I need to do a better job explaining.

    I use the xlsm file to convert all the raw data. Once that is converted I have a xls file that needs to be compared and any invoices that are in the xls file with false need to be removed out of the xlsm file. Would be nice so I can do all the converting and removing of invoices that are in the xls file at the same time. If I had a module that does the comparing and removing so I could just add that within the xlsm file. If I have to do it separately that would be ok. I have attached the xlsm file and also the xls file that will show what invoices need to be removed "any with false in column D".

    Attached is the xlsm file blank, xlsm file with raw data and the xlsm file after the conversion.
    I also attached the xls file that will be used to compare to the xlsm file and need those invoices removed from the xlsm file. All invoices with false in column D need to be removed from the xlsm file. Best would be to have the false invoices removed after the data is converted.

    If I did not explain that good enough let me know


    Thanks all for help. This is stopping me from being able to upload my invoices into the accounting program.
    Attached Files Attached Files

  5. #5
    Paul
    Thanks for Help and all help in the past. You also helped me create the xlsm file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •