How can i see if the activecell contains "º" (this symbol)
Need something like:
thanks in advanceSelect case true case Activecell.value contains "º" MSGBOX "value has º symbol" end select
How can i see if the activecell contains "º" (this symbol)
Need something like:
thanks in advanceSelect case true case Activecell.value contains "º" MSGBOX "value has º symbol" end select
If InStr(1, ActiveCell.Value, "º") Then MsgBox "Value has º symbol"
I'm interested in starting a career working with VBA, if anyone knows of any opportunities!
i had simular solution, but it's giving me error.
I had this:
For SecçõesDePassagemAbate = NrColPrimeiraSecçãoPassagem To NrColUltimaSecçãoPassagem 'Abate todas as secções que passam anteriormente Select Case True 'instr procura o valor "º" nas secções de passagem , e tem ainda que o valor da secção de passagem ser inferior ao valor da secção atual Case InStr(1, ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).Value, "º", 1) And ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).Value < CelulaSecçãoAtual.Value 'São as secções onde ainda deve passar (exclui os vazios e datas) ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).font.Color = -16776961 'Coloca a Vermelho ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).font.Bold = True 'Coloca BOLD nas secções que foram abatidas por outras secção ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).Value = Format(Now, "YYYY-MM-DD") Case Else 'MsgBox "do nothing" 'Continua e vai meter apenas na secção atual End Select Next SecçõesDePassagemAbate
It says object required, and highlights this:
Case InStr(1, ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).Value, "º") And ActiveSheet.Cells(ActiveCell.Row, SecçõesDePassagemAbate).Value < CelulaSecçãoAtual.Value 'São as secções onde ainda deve passar (exclui os vazios e datas)
Hard to say, I don't know what any of your variables are. I would guess that CelulaSecçãoAtual is not an object, though.
Posting your worksheet and the whole Sub would lead to the fastest solution.
duplicated, sorry.
Last edited by brainzlp; 01-21-2016 at 01:00 PM.
I believe the 1 is optional, it's the position in the string you want InStr to start at. I believe 1 (the first character in the string) is the default
i removed it and it's ok. It's a comparison mode for database, binary something and so on. Without the 1 it works.
Thanks for your help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks