问题
I am trying to select range. I have no problem selecting it with variable, lets say x and y are variables. I have no problem writing code to select range from e.g. A1:By
. But How do I select a range from Ax:By
? Is there simple one line solution to this?
Thanks in advance for help
My code for A1:By which works
Sheets("Sim").Range("A1:B" & y).Select
My made code from Ax:By which does not work
Sheets("Sim").Range("A" & x ":B" & y).Select
回答1:
You left out an ampersand....
Sheets("Sim").Range("A" & x & ":B" & y).Select
来源:https://stackoverflow.com/questions/46449578/vba-select-range-with-two-variables