ismokenov1991
New Member
Hey there
So I have just started learning vba by reading watching etc.
there is this interesting code that i have saw on the internet but I dont understand some lines hope you could explain to me, it might be actually easy but i am confused with some lines.
Here is it
I have really huge problem understanding how is the IF statement used here, especially with the offset function and "<>". From what I see, if the selected cell has value(number or word) then is should go down one row is it?
I would really appreciate if someone could explain it to me or gave links to the places where people have had similar problems with this functions.
And yes, this sub is meant to transport data from one sheet to another.
Thanks
Isken
So I have just started learning vba by reading watching etc.
there is this interesting code that i have saw on the internet but I dont understand some lines hope you could explain to me, it might be actually easy but i am confused with some lines.
Here is it
Code:
Private Sub TrSheet ()
Dim CustomerName As String, CustomerProblem As Integer
Worksheets("Sheet1").Select
CustomerName = Range("C4")
CustomerProblem = Range("C5")
Worksheets("sheet2").Select
Worksheets("sheet2").Range("B4").Select
If Worksheets("sheet2").Range("B4").Offset(1, 0) <> "" Then
Worksheets("Sheet2").Range("b4").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = CustomerName
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = CustomerProblem
Worksheets("sheet1").Select
Worksheets("sheet1").Range("C4").Select
End Sub
I have really huge problem understanding how is the IF statement used here, especially with the offset function and "<>". From what I see, if the selected cell has value(number or word) then is should go down one row is it?
I would really appreciate if someone could explain it to me or gave links to the places where people have had similar problems with this functions.
And yes, this sub is meant to transport data from one sheet to another.
Thanks
Isken