moving row/cell values to another sheet if row is true

Sweedler

New Member
Joined
Nov 13, 2020
Messages
33
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
moving row/cell values to another sheet if row is true

1607962743530.png

1607962834648.png


Ok,

So here is tough one .. maybe.

From my first sheet I have a product list with a checkbox next to each one . The checkbox is linked to the cell that it is in and then that cell font is white to make the TRUE/FALSE value invisible. What I want to do is that based on the TRUE/FALSE value of the check box I want the value in column C to be moved into column A in the other sheet. I would prefer for the value to disapear as well if the value is altered to FALSE.

IDEAS?
 
Last edited by a moderator:

maras

New Member
Joined
Dec 12, 2019
Messages
33
Office Version
  1. 2010
Platform
  1. Windows
@Sweedler, assign a code to the button and run.
VBA Code:
Sub Moving_True()
    Dim a(), rws
    Dim rng As Range
    Dim lr As Integer
    
    With Sheets("artikellista")
        lr = .Cells(Rows.Count, "C").End(xlUp).Row
        Set rng = .Range("B6:C" & lr)
        a = rng.Value
    End With
    With rng
        rws = Filter(.Parent.Evaluate("transpose(if((" & .Columns(1).Address & "=" & True & "),row(1:" & .Rows.Count & ")))"), False, 0)
    End With
    If UBound(rws) > -1 Then
        With Sheets("beställningsunderlag")
            .Range("A" & .Cells(Rows.Count, "A").End(3).Row)(2).Resize(UBound(rws) + 1) = Application.Transpose(Application.Index(a, rws, 2))
        End With
    End If
    Set rng = Nothing
End Sub

 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Watch MrExcel Video

Forum statistics

Threads
1,126,999
Messages
5,622,118
Members
415,878
Latest member
jjj12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top