text from a cell to VBA
text from a cell to VBA
(OP)
Hello everybody,
I need help. I'm making a VBA code to work with an excel sheet. One of the functions of the VBA code is to do something depending on the value of a cell. The value of the cell is a text value, if the cell reads "END" then the code has to do something. The problem is that when I input the word END to the cell the code does not work, but if i input: ="END" then the code works. In my first attempt to make the code everything worked fine, but then I deleted a column that I wasn't using and the problem with the text in the cell started. I don't know if I moved something by mistake but I don't seem to make it work again.
Please help me because I ran out of ideas.
Jose Luis Walters.
I need help. I'm making a VBA code to work with an excel sheet. One of the functions of the VBA code is to do something depending on the value of a cell. The value of the cell is a text value, if the cell reads "END" then the code has to do something. The problem is that when I input the word END to the cell the code does not work, but if i input: ="END" then the code works. In my first attempt to make the code everything worked fine, but then I deleted a column that I wasn't using and the problem with the text in the cell started. I don't know if I moved something by mistake but I don't seem to make it work again.
Please help me because I ran out of ideas.
Jose Luis Walters.





RE: text from a cell to VBA
CODE
MyInput= Range("A1").Text
RE: text from a cell to VBA
Dim FinalRow As String, NextRow As Integer
FinalRow = Range("A1000").End(xlUp)
If FinalRow = "FIN" Then
Sheets("S2").Select
NextRow = Worksheets("S2").Range("A1000").End
(xlUp).Row + 1
Worksheets("S2").Cells(NextRow, 1).Select
End If
I'm using the word "FIN", END in spanish, and my version of office is in english.
The code has to detect the last used cell in column A and if the text in the cell reads "FIN" it has to select the next empty cell in column A in sheet "S2". But i have to input ="FIN" to the cell to make it work, but like I said in my first attempt it worked fine with just writing FIN into the cell.
RE: text from a cell to VBA
Your code works fine on my machine even using END
Go figure...
RE: text from a cell to VBA
RE: text from a cell to VBA
Can anyone help me with this problem?
RE: text from a cell to VBA
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: text from a cell to VBA
RE: text from a cell to VBA
RE: text from a cell to VBA
Try using the Change event instead of the Calculate event. Or use both if you need to.
RE: text from a cell to VBA
Jose Luis Walters