hi
i need some help
i havethis formula
=RIGHT(B1,LEN(B1)-FIND(":",B1))
how can i right this formula in vba code??
thanks
Oleg
hi
i need some help
i havethis formula
=RIGHT(B1,LEN(B1)-FIND(":",B1))
how can i right this formula in vba code??
thanks
Oleg
Hi Oleg,
At it's simplest:
ActiveCell.Value = "=RIGHT(B1,LEN(B1)-FIND("":"",B1))"
Cheers
Paul Edstein
[Fmr MS MVP - Word]
hi
it does not work if i out instead of "B1" variable
can i do this with variables?
Without using any worksheet functions.
[VBA]ActiveCell.Value = Right(Range("B1"), _
Len(Range("B1")) - InStr(Range("B1"), ":"))
[/VBA]
Hi Oleg,
It is not clear what you want. Perhaps:
[VBA]Dim i As Integer
For i = 1 To 10
ActiveSheet.Range("B" & i).Value = "=RIGHT(B" & i & ",LEN(B" & i & ")-FIND("":"",B" & i & "))"
Next[/VBA]
Cheers
Paul Edstein
[Fmr MS MVP - Word]
what i want that i have a variable "myvar" and it equals $G$291
i need that i cell q1 i will see "G" and in q2 "291"
sorry for explanations i an working online
thanks for all the help you are given me
[VBA]Dim myvar As String
myvar = ActiveSheet.Range("Q1").Value & ActiveSheet.Range("Q2").Value
ActiveCell.Value = "=RIGHT(" & myvar & ",LEN(" & myvar & ")-FIND("":""," & myvar & "))"[/VBA]
Cheers
Paul Edstein
[Fmr MS MVP - Word]
Even though there really is, as far as I know, no difference in the execution, I would recommend using ".Formula" instead of ".Value", purely for the fact of debugging code or performing maintenance on it.
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables