Excel VBA input data to next empty Range

Closed
Niroth Posts 1 Registration date Thursday April 30, 2015 Status Member Last seen April 30, 2015 - Apr 30, 2015 at 09:47 PM
MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 - May 1, 2015 at 08:09 AM
HI everyone, I am excel vba stater I have crazy problem to solve. I want to input data into range j6 by use inputbox and if j6 had value next input will down to range j7. here is my code:
Sub FETCH_Data()
Dim x As Integer

x = InputBox("Enter the Code :")
Range("J6").Value = x

End Sub

What should I do next?

1 response

MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69
May 1, 2015 at 08:09 AM
Sub FETCH_Data()
Dim x As Variant
x = InputBox("Enter the Code :")
    If x <> "" Then
        If Range("J6").Value <> "" Then
            Range("J7").Value = x
        Else
            Range("J6").Value = x
        End If
    End If
End Sub

0