+ Reply to Thread
Results 1 to 10 of 10

Help! combining 2 VBA codes

  1. #1
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Help! combining 2 VBA codes

    How do I combined these 2 codes into one VBA code?

    The first code is a recorded macro

    Please Login or Register  to view this content.
    The second code is

    Please Login or Register  to view this content.
    Last edited by iamreese; 03-29-2012 at 08:26 AM.

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Help! combining 2 VBA codes

    maybe You can use call method
    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Help! combining 2 VBA codes

    Hi..thanks for the quick reply..

    I tried running the code you suggested and it did run correctly except for the third row where it did not delete the empty cells and gave me a debug error message

  4. #4
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Help! combining 2 VBA codes

    Hi
    Could You send the sample file with description what You want achieve

  5. #5
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Help! combining 2 VBA codes

    attached are 2 excel files.

    start.xlxs refers to the original file before applying the code

    result.xlxs will be the end result after applying the code. I had to run 2 codes separately.
    Attached Files Attached Files
    Last edited by iamreese; 03-29-2012 at 04:42 AM.

  6. #6
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Help! combining 2 VBA codes

    try to use this
    If You have a lot of data it could take a moment
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Help! combining 2 VBA codes

    Hi..the code was almost perfect but some issues

    1. If cell in column C is empty, corresponding columns A and B should also be deleted.
    2. empty cell in column A should copy the cell above it.
    Last edited by iamreese; 03-29-2012 at 06:32 AM.

  8. #8
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Help! combining 2 VBA codes

    please check attachment
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Help! combining 2 VBA codes

    ^^ hi..see 2 issues on my prior post

    this conditions should be met:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Last edited by iamreese; 03-29-2012 at 07:01 AM.

  10. #10
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Help! combining 2 VBA codes

    Hi
    I am uploading new file because in the previous one was mistake (the results are the same You wanted in your file call "results")

    p.s. I do not follow your last post....
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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