Link to home
Start Free TrialLog in
Avatar of Shane Russell
Shane RussellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Part 2 to the question in the URL :

Please go here to see the question :

https://www.experts-exchange.com/questions/21335618/Excel-VBA-Code-Problem-S.html

Then my next part to this question is :

Will that code work with cell references that are larger then ie 1 letter and a few digits, ie cell ref # AA145 or EV364 ?? If not , then what do I need to do to alter the code so its simmiliar to that so it will work ?

Thanks and kind regards :)

Gecko
Avatar of vinnyd79
vinnyd79


Will this work?

Dim temp1, temp2, temp4

x = 0
temp1 = ""
While Not IsNumeric(Right(temp1, 1))
    x = x + 1
    temp1 = Mid(txtName.ControlSource, 1, x)
Wend

x = x - 1
temp1 = Left(temp1, x)

temp2 = Val(Mid(txtName.ControlSource, x + 1)) + 1
temp4 = temp1 & temp2 'Concatenation of temp1 and temp2 to create new cell refernce to move to
txtName.ControlSource = temp4
Avatar of Shane Russell

ASKER

I will give it a go later on, I have stuff to do today but will post back later on with regards to how it went. Thanks vinnyd79
Avatar of Harisha M G
gecko I think you won't accept anything other than the one in your mind :(
It works to go to the next cell reference but what would I have to do in order to make it go to previous cells ? Then you got yourself the points !!
ASKER CERTIFIED SOLUTION
Avatar of vinnyd79
vinnyd79

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok thanks :)