+ Reply to Thread
Results 1 to 10 of 10

Code to move value when 3 criteria given

  1. #1
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Code to move value when 3 criteria given

    Hi all,

    I need a simple code to move value from one sheet to another according to 3 criteria:

    Location (sheet) - depending which check box is checked
    Row (product)
    Date (Column)

    See the attached sample workbook.

    Thanks



    For forum Admins:

    This is Cross-Post of:
    http://www.excelforum.com/excel-prog...the-array.html

    Actually this is much simplified version as nobody could help me on the previous one. I'm sure someone will solve this. However, if you're going to close thread, please close the original thread as it is not active at all.

    Thanks
    Attached Files Attached Files
    Last edited by ABSTRAKTUS; 04-15-2011 at 02:33 PM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Code to move value when 3 criteria given

    hi, ABSTRAKTUS, what is Batches number states for?

  3. #3
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Code to move value when 3 criteria given

    Hi watersev,

    This is just a numeric value.

    All I need is just to transfer that value to the the sheet according which checkbox is checked (UNIT 2 or 3), then find its place in the sheet according which product and date were selected in the main sheet. Sounds simple, but not for me...

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Code to move value when 3 criteria given

    please check attachment, I'm not sure the button will work (it was created by me for testing purpose instead of yours) but the code must work
    Attached Files Attached Files
    Last edited by watersev; 04-15-2011 at 11:10 AM.

  5. #5
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Code to move value when 3 criteria given

    Thanks watersev,

    The sample workbook works fine. I had a look at you code and I don't think I will be able to adapt i to fit my needs on the original workbook. The code is just too clever for me.

    I was using something simple code, but it is not affected by selection of checkboxes.

    Code:

    Sub TransferToArray()

    Dim FR As Long, FC As Long
    If Worksheets("PLANNER").Range("V30") = "" Then
    MsgBox "No input can be made"
    Exit Sub
    End If
    Application.ScreenUpdating = False
    FR = Application.Match(Worksheets("PLANNER").Range("K24"), Worksheets("U2 BATCHES").Columns(1), 0)
    FC = Application.Match(Worksheets("PLANNER").Range("U26"), Worksheets("U2 BATCHES").Rows(3), 0)
    If FR <> 0 And FC <> 0 Then
    Worksheets("U2 BATCHES").Cells(FR, FC).Value = Worksheets("PLANNER").Range("V30").Value
    End If
    Application.ScreenUpdating = True
    End Sub

    Active cell for both checkboxes are in the sheet "CORE" in G2.

    Thanks a ton mate! Sposibo!

  6. #6
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Code to move value when 3 criteria given

    here is the actual workbook if you need to have a look.

  7. #7
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Code to move value when 3 criteria given

    Oooops, forgot atachment...
    Attached Files Attached Files

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Code to move value when 3 criteria given

    @ABSTRAKTUS

    You should put code tags around your code before a mod catches you.

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Code to move value when 3 criteria given

    check attachment
    Attached Files Attached Files

  10. #10
    Forum Contributor ABSTRAKTUS's Avatar
    Join Date
    04-18-2010
    Location
    England
    MS-Off Ver
    Win10 Excel 2016
    Posts
    609

    Re: Code to move value when 3 criteria given

    You're a star man! Thanks!

+ 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