cole valores especiais em vba
Eu estou trabalhando em um pequeno projeto que exige que eu copie e cole certas colunas se eu detectar "true" na linha. Eu estou tentando colar essas colunas selecionadas em uma folha diferente e quero colar apenas seus valores não as fórmulas.
Isso é o que eu tenho até agora e estou recebendo um erro com o recurso especial de colar. Por favor ajude.
' CopyIfTrue()
Dim Col As Range, Cell As Excel.Range, RowCount As Integer
Dim nysheet As Worksheet
Set nysheet = Sheets.Add()
nysheet.Name = "T1"
Sheets("FemImplant").Select
RowCount = ActiveSheet.UsedRange.Rows.Count
Set Col = Range("I2:I" & RowCount) 'Substitute with the range which includes your True/False values
Dim i As Integer
i = 1
For Each Cell In Col
If Cell.Value = "True" Then
Cell.Copy
Sheets("T1").Select 'Substitute with your sheet
Range("b" & i).Select
ActiveSheet.Paste
'Get sibling cell
Sheets("FemImplant").Select
Dim thisRow As Integer
thisRow = Cell.Row
Dim siblingCell As Range
Set siblingCell = Cells(thisRow, 2)
siblingCell.Copy
Sheets("T1").Select 'Substitute with your sheet
Range("a" & i).Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues
Sheets("FemImplant").Select
i = i + 1
End If
Next