+ Reply to Thread
Results 1 to 3 of 3

HELP !!How to add values to sheets based on two conditions

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    26

    HELP !!How to add values to sheets based on two conditions

    Hello all.

    i tried to add the value of a comboBox to the first empty row -in the whole sheet- in column 1, and some other information to the first three empty cells in column to the left.


    Now What i need is to Check if the the value of the combobox is already there in column 1 cells then add the information in the first empty column in the left to three cells, If not, add the the value to the first empty row in the whole sheet in column 1 and add the information in the column left to it.


    Here is what i tried
    Please Login or Register  to view this content.
    Thanks in advance for everything.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: HELP !!How to add values to sheets based on two conditions

    Hi, Abo Rawad,

    you could either use Find to set a range if the value is found in Column A or use WorksheetFunction.Match for that. If either the range is nothing (no item found) or the variable for match delivers an error new data needs to be added while otherwise the range will deliver the row on which to take further action:

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: HELP !!How to add values to sheets based on two conditions

    Thank you soooooooooo much , HaHoBe.

    This is my code after using your smart idea, it works exactly the way i wanted.
    and even shorter and faster than looping.

    God bless you, dear

    Please Login or Register  to view this content.

+ 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