22.03.2020, 19:57
(Dieser Beitrag wurde zuletzt bearbeitet: 22.03.2020, 20:02 von WillWissen.
Bearbeitungsgrund: Schriftgröße
)
Hi,
I. am new to VBA, I need help with this question on cell referencing and offset
Create a subroutine called WherePutMe that asks the user for a row number and column letter then places the 2,2 position of a selection into that cell. (HINT: Make sure that you select a selection before running the sub!)
Your subroutine will take the 2,2 position of the initial selection (-4 in our example) and place it in cell C7 (specified by the user in the two input boxes):
[
Bild bitte so als Datei hochladen: Klick mich!
]
Sub WherePutMe ()
Dim x As Integer, y As String, z As Double
x = InputBox ("please input the row number:")
y = InputBox ("please input the column letter:")
Range (y & x) = z
ActiveCell.Offset (2, 2) = z
End sub
This is my code but I am not arriving at the right answer, can someone point me to what I am doing wrong? Thanks
I. am new to VBA, I need help with this question on cell referencing and offset
Create a subroutine called WherePutMe that asks the user for a row number and column letter then places the 2,2 position of a selection into that cell. (HINT: Make sure that you select a selection before running the sub!)
Your subroutine will take the 2,2 position of the initial selection (-4 in our example) and place it in cell C7 (specified by the user in the two input boxes):
[
Bild bitte so als Datei hochladen: Klick mich!
]
Sub WherePutMe ()
Dim x As Integer, y As String, z As Double
x = InputBox ("please input the row number:")
y = InputBox ("please input the column letter:")
Range (y & x) = z
ActiveCell.Offset (2, 2) = z
End sub
This is my code but I am not arriving at the right answer, can someone point me to what I am doing wrong? Thanks