Hello
I am stuck and i need help with a macro that will do:
1) check column B in sheet1 and if the cell contain the word "dim"
copy the containment of the cell to sheet2 started in A2
Thanks
Hello
I am stuck and i need help with a macro that will do:
1) check column B in sheet1 and if the cell contain the word "dim"
copy the containment of the cell to sheet2 started in A2
Thanks
[VBA]Sub copyDim()
Dim i As Long, sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets(1)
Set sh2 = Sheets(2)
i = 2
Do Until sh1.Cells(i, 2) = ""
If InStr(UCase(sh1.Cells(i, 2)), "DIM") > 0 Then
sh1.Cells(i, 2).Copy _
Destination:=sh2.Cells(Rows.Count, 1).End(xlUp).Offset(1)
End If
i = i + 1
Loop
End Sub[/VBA]
hi
thanks
how can i see in the macro the column A or B?
The Cells function uses the Format of:Originally Posted by oleg_v
Cells(Row#,Column#)
The macro is looking for the "dim" in sh1.Cells(i,2) or column #2 (column B) of sheet 1, while the destination is sh2.Cells(first blank row,1) or column #1 (column A) of sheet 2