+ Reply to Thread
Results 1 to 15 of 15

2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If state

  1. #1
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Lightbulb 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If state

    So here's my issue.
    I've been tasked with creating a macro for an accounting co. I have one portion completed that copies and pastes personal info from one sheet to another.
    But the major issues I'm having is I need to take data from one sheet. (7 rows (A1-A7 and 3 Columns (A1-A3)) And what I need to do is copy and paste in specific row/column only.
    Example:
    Name | money | percent
    Name2 | money |percent
    Name3 | blank |blank
    Name4 | money percent

    I need to be able to copy all the data from Name, money and percent and paste into a seperate sheet plus add the letter "F" in this format:
    Name| leave blank |money | leave blank | percent | F

    and at the same time not include the Name3 with the 2 blanks because it doesn't contain data

    the copy and paste features I have, but I can't remember how to write the If/end if statements using the VBA libraries. I haven't programmed since 2001 in college and a family member is in need of help.

    Thank you for your support

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Hi CPD2001
    Welcome to the Forum

    Please attach a sample workbook with a before & after scenario making sure that your desired solution is shown - mock up the results manually if need be.
    Originally Posted by Pete_UK
    To attach a file, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    So on "sheet2", I have 3 columns. Payment type, Assignee and percentage, What I'm trying to do is extract all 3 (Only if there
    is data in the assignee and percentage column). If there is no data in those 2 rows, I need to pass over it
    (or something like that).
    Then I need to paste that information in the "sheet1" starting in the blank row below pay code with "Payment" in the
    pay code section, "Assignee" in the Annual Amount section, Add "US" automatically in currency code, Add "F" in paycode type
    and "percentage" and put that into the projection growth rate slot.

    All while filling up each row kind of how it's stacked in "Sheet2"

    I uploaded screen shots to help, I thank you for assistance on this
    Attached Images Attached Images

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Sorry images are not visible and do not depict requirement.
    Please attach a sample workbook with a before & after scenario making sure that your desired solution is shown - mock up the results manually if need be.

  5. #5
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Here is the uploaded file of what I'm trying to achieve

    You'll see that out of the 7 rows of data on "Sheet2", only 3 were entered on "sheet1" since the remainder of the data
    was null in both assignee and inflation
    Attached Images Attached Images

  6. #6
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Ok, here are the more up to date pictures if this helps. Info from both sheets and desired outcome
    Attached Images Attached Images

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Unfortunately you are not complying to the request.....I repeat.....
    Sorry images are not visible and do not depict requirement.
    Please attach a sample workbook with a before & after scenario making sure that your desired solution is shown - mock up the results manually if need be.
    To attach a file, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post

  8. #8
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    My mistake, I was taking screen shots instead. Here are the 2 quick work books.
    1st is the information
    2nd is how I'm looking for the outcome to be

    Both sheets and their data are in exact location in reference to each other per row/columns
    Attached Files Attached Files

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Cool...
    1.Are both workbooks open at the same time
    2.Is there more than one instance
    3.Is the currency and payment code always US & F
    4.Is the Source information always in Sheet2 and the Target information in Sheet1


    EDITED:
    The below code has been tested and works as per requirement
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 05-12-2017 at 10:04 AM.

  10. #10
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    1. This will be a single woorkbook, 2 worksheets
    2. There is not more than one instance
    3. Yes, currency code and and F stay the same
    4. Correct, Source will always be sheet2 and target sheet1

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Right, have a look at amended code and new workbook in Post9

  12. #12
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Awesome, I just got the code, will implement into the macro this evening, Thank you!

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Hi CPD2001

    I see you opened another thread with more elaborate requirements....This is fine. Please, however, mark this thread as solved as the initial request and code provided tests successful. Thanks for rep points added...

  14. #14
    Registered User
    Join Date
    05-11-2017
    Location
    Irvine, CA
    MS-Off Ver
    2007
    Posts
    10

    Thumbs up Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    Thanks to Sintek, This thread has been SOLVED

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: 2 issues. Between 2 sheets. cant remember the proper coding for using the If/End If st

    To mark your thread solved do the following:
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 04-18-2016, 03:41 PM
  2. [SOLVED] Issues with VBA Coding and Dependent Combo Boxes
    By Stlcards13 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-16-2015, 03:18 PM
  3. When/why does the VBIDE remember/forget its window state/position?
    By jasmith4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2015, 04:51 PM
  4. [SOLVED] Lookup State Name from State Code and and Display in column in COUNTIES worksheet.
    By Jim15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2014, 02:41 PM
  5. Can't remember how to link info from other sheets
    By louise2613 in forum Excel General
    Replies: 10
    Last Post: 08-15-2013, 02:10 PM
  6. Runtime Error 9: Subscript out of Range But no Coding Issues...
    By pillsbury44 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-09-2012, 01:26 PM
  7. issues with coding problem
    By parteegolfer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2006, 04:29 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