Results 1 to 6 of 6

Trying to add a change to a VBA marco

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-24-2017
    Location
    Vic Australia
    MS-Off Ver
    Office 365 Apps for enterprise
    Posts
    147

    Trying to add a change to a VBA marco

    Good afternoon

    this post is relating to another post
    https://www.excelforum.com/excel-for...-best-way.html Which has since been closed 01-26-2018
    as we where able to get a sheet working

    I have been using this sheet for the passed month and now 3 different departments now use it and its working great
    I have tried to read and learn from the VBA not having much luck


    The problem I am finding is I would like to add 1 column on the Pick order sheet
    I am trying to add Delivery Name From picking Column M to the Pick order Column G
    and not having much luck I can see I'm missing some thing in the code just cant work out which bit it is

    I changed the lines of code that I could work out

    With Worksheets(cShPickOrder)
        .Range("A1").CurrentRegion.Borders.LineStyle = xlContinuous
        .Range("A1").Resize(, 7) = [{"Truck ID"    ,"Load No" ,"Pickup Time" ,"Order ID"    ,"Min Status",  "Max Status",   "Delivery Name"}]
     End With
    Which added Delivery Name

    Then I looked at the arr and added arr(i, 13) to both which caused the sheet to debug


    Set dict = CreateObject("scripting.dictionary")
     With dict
        For i = 1 To UBound(arr)
            If Not .exists(Trim$(arr(i, 3))) Then
                ReDim w(0)
                w(0) = Array(arr(i, 1), arr(i, 6), arr(i, 7), arr(i, 13))
            Else
                w = .Item(Trim$(arr(i, 3)))
                ReDim Preserve w(UBound(w) + 1)
                w(UBound(w)) = Array(arr(i, 1), arr(i, 6), arr(i, 7), arr(i, 13))
            End If
            .Item(Trim$(arr(i, 3))) = w
        Next
    then after rereading

    changed

    With Worksheets(cShpicking)
        arr = .Range("A2", .Cells(Rows.Count, "M").End(xlUp))
     End With
    This still leaves the new column Blank but does not debug the sheet any more

    I have tried to play around with other parts of the code and everything I have tried places it in to a debug state

    I have attached the excel sheet from the other Post also

    Any help would be great
    JustinwB
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to create a Marco to run same Marco run on everysheet.
    By chriskingkiller in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2013, 02:53 AM
  2. [SOLVED] Marco to change text of form buttons based on language
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2013, 10:52 AM
  3. Run marco of a source file in the source file via marco of a master patch file
    By freeman6479 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2012, 10:55 AM
  4. How to Change Excel Marco upload from FTP to SFTP?
    By triniti in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2012, 08:14 AM
  5. Who is this Marco?
    By arthurbr in forum The Water Cooler
    Replies: 16
    Last Post: 09-05-2010, 06:02 AM
  6. Change automatically level security of Marco
    By nguyennb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2009, 03:55 AM
  7. help me with this marco
    By lwong in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-21-2006, 09:01 PM
  8. Marco Help
    By schlempyasst in forum Excel General
    Replies: 0
    Last Post: 05-04-2005, 07:30 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1