BalbasNiBarabas
New Member
- Joined
- Jun 1, 2020
- Messages
- 5
- Office Version
- 2019
- Platform
- Windows
Hello guys!
So I am a beginner in VBA. I am actually just starting. I am a taking a course on it. So I have encountered a problem in this case:
What I need to do is:
1. Input row number and column letter in a separate Input box.
2. Get a value from (2,2) of a selection.
3. Put that value from (2,2) to the defined row number and column.
In my local, I can do the item 1 and 2. However, I am having a difficulty on doing the 3rd one. Below is my code:
I keep on having error on my range line. I how you can help me with this and give explanation.
Thanks!
BNB
So I am a beginner in VBA. I am actually just starting. I am a taking a course on it. So I have encountered a problem in this case:
What I need to do is:
1. Input row number and column letter in a separate Input box.
2. Get a value from (2,2) of a selection.
3. Put that value from (2,2) to the defined row number and column.
In my local, I can do the item 1 and 2. However, I am having a difficulty on doing the 3rd one. Below is my code:
VBA Code:
Sub Test()
Dim x As Integer, y As String, z As Double
x = InputBox("number:")
y = InputBox("letter:")
z = Selection(2, 2)
Range(x, y) = z
End Sub
I keep on having error on my range line. I how you can help me with this and give explanation.
Thanks!
BNB