+ Reply to Thread
Results 1 to 3 of 3

Copy value in one Sheet, Look for it in a certain row in another sheet.

  1. #1
    Registered User
    Join Date
    05-26-2022
    Location
    Pretoria, South Africa
    MS-Off Ver
    Office 365
    Posts
    2

    Copy value in one Sheet, Look for it in a certain row in another sheet.

    Good morning guys,

    My VBA skills are for a lack of a better word, not great, so any assistance will be greatly appreciated.

    I'll do my best to describe the scenario. I am leaving out some details, as it'll take a while if I need to describe the sheet in detail. I'm sorry if it's confusing. I'll post the current code I have at the bottom.

    So I have a sheet with multiple tabs. One of the tabs contain data that I use for a few dependent drop downs in the first tab.

    When the first tab with drop downs is populated(Main Tab), I have a "Copy" button that needs to copy Column A4:A24;A61(Main Tab) to one of 4 tabs, depending on Cell A4's value.

    What I'm trying to achieve is the following.

    Cell A5(Main Tab) contains the number that's associated with the data contained in Cells A4:A24;A61(Main Tab).
    I need to incorporate a VBA code that copies A4:A24;A61(Main Tab) then goes to the correct tab(Looked Up Tab) which is specified by Cell A4(Main Tab), then looks up the value of A5(Main Tab) in row 2:2(Looked Up Tab). If the value is found, it needs to two things.

    First check if there is already data in cells A1:A22(Looked Up Tab), and if there is data, sum the data from A7:A24(Main Tab) with the data in A4:A21(Looked Up Tab),
    If this condition is not met, it needs to add all the Copied Data to the last column.

    So below is my current VBA code.
    I know it's messy, so any corrections will be appreciated.




    Please Login or Register  to view this content.
    Last edited by AliGW; 08-02-2022 at 04:01 AM. Reason: Code tags added.

  2. #2
    Registered User
    Join Date
    05-26-2022
    Location
    Pretoria, South Africa
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Copy value in one Sheet, Look for it in a certain row in another sheet.

    I'll Attach the sheet that I'm referring to, in order to make it less confusing.
    Attached Files Attached Files

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Copy value in one Sheet, Look for it in a certain row in another sheet.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are still new here, I have done it for you this time. )
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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: 03-01-2022, 03:25 AM
  2. Replies: 0
    Last Post: 07-28-2021, 08:00 AM
  3. Replies: 2
    Last Post: 01-23-2016, 01:16 PM
  4. Replies: 2
    Last Post: 01-18-2014, 10:54 PM
  5. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  6. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  7. Replies: 11
    Last Post: 10-14-2012, 01:03 PM

Tags for this Thread

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