Ok what I need this is this: if visible cells in a range (ie: c7:j200) have a value of 'X', the the second range (ie:c6:j6) will be copied and transposed onto a new sheet into given columns.
I have not worked out the IF section of the code. (IE: IF visible cells have a value of "X" copy the cell in the second range to the corresponding column) (A for A, B for B, C for C, etc...)
Instead of using the "X" value as a condition of copying, it is just copying "X" into the initial range ( ie: c7:j200) however, I can get the ranges to copy perfectly.
If someone can show me how to modify the code in order to realize "X" as a condition of the code that would be very helpful.
Sub Button83_Click()
ActiveSheet.Unprotect "="
Sheets("Database").Range("C7:J200").SpecialCells(xlCellTypeVisible).Value = ("X")
Range("C6:J6").Copy
Sheets("Output").Range("C604").PasteSpecial Transpose:=True
Sheets("Database").Range("K7:T200").SpecialCells(xlCellTypeVisible).Value = ("X")
Range("K6:T6").Copy
Sheets("Output").Range("D604").PasteSpecial Transpose:=True
Sheets("Database").Range("U7:AE200").SpecialCells(xlCellTypeVisible).Value = ("X")
Range("U6:AE6").Copy
Sheets("Output").Range("E604").PasteSpecial Transpose:=True
ActiveSheet.Protect "="
End Sub
if you did not understand the explanation please tell me so I can clarify. I just dont know how to explain because I am not VBA savvy.
I have not worked out the IF section of the code. (IE: IF visible cells have a value of "X" copy the cell in the second range to the corresponding column) (A for A, B for B, C for C, etc...)
Instead of using the "X" value as a condition of copying, it is just copying "X" into the initial range ( ie: c7:j200) however, I can get the ranges to copy perfectly.
If someone can show me how to modify the code in order to realize "X" as a condition of the code that would be very helpful.
Sub Button83_Click()
ActiveSheet.Unprotect "="
Sheets("Database").Range("C7:J200").SpecialCells(xlCellTypeVisible).Value = ("X")
Range("C6:J6").Copy
Sheets("Output").Range("C604").PasteSpecial Transpose:=True
Sheets("Database").Range("K7:T200").SpecialCells(xlCellTypeVisible).Value = ("X")
Range("K6:T6").Copy
Sheets("Output").Range("D604").PasteSpecial Transpose:=True
Sheets("Database").Range("U7:AE200").SpecialCells(xlCellTypeVisible).Value = ("X")
Range("U6:AE6").Copy
Sheets("Output").Range("E604").PasteSpecial Transpose:=True
ActiveSheet.Protect "="
End Sub
if you did not understand the explanation please tell me so I can clarify. I just dont know how to explain because I am not VBA savvy.