PDA

View Full Version : Extract partial value from cell



olegvolf
05-20-2015, 12:43 AM
Hello

I need some help.
I now how to attach cell`s value to a variable but if
i have in the cell:
example:
3.1 to 3.2
how i attach to 2 different variables
one is 3.1
second 3.2

Thank you





Detect languageAfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBengaliBelarusianBu lgarianCatalanChinese (Simp)Chinese (Trad)CroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrench GalicianGeorgianGermanGreekGujaratiHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIri****alianJapaneseKannadaKor eanLaoLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPor tugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTamilTelug uThaiTurkishUkrainianUrduVietnameseWelshYiddish


AfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBengaliBelarusianBulgarianC atalanChinese (Simp)Chinese (Trad)CroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrench GalicianGeorgianGermanGreekGujaratiHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIri****alianJapaneseKannadaKor eanLaoLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPor tugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTamilTelug uThaiTurkishUkrainianUrduVietnameseWelshYiddish



















Text-to-speech function is limited to 100 characters

Options (http://www.vbaexpress.com/forum/chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/content/html/options/options-bbl.html) : History (http://www.vbaexpress.com/forum/chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/content/html/options/history.html) : Help (http://about.imtranslator.net/tutorials/presentations/imtranslator-for-chrome/) : Feedback (http://www.vbaexpress.com/forum/chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/content/html/options/feedback.html)

SamT
05-20-2015, 01:34 AM
Dim Minn As Double
Dim Maxx As Double
Dim EndMinn As Long
Dim BeginMaxx As Long

EndMinn = InStr(YourVariable, " ") - 1
BeginMaxx = InStrRev(YourVariable, " ") + 1

Minn = CDbl(Left(YourVariable, EndMinn))
Maxx = CDbl(Right(YourVariable, Len(YourVariable - BeginMaxx)))

olegvolf
05-20-2015, 03:07 AM
Hello
Thank you for your replay.
i have an error in this line - (miss match)

Maxx = CDbl(Right(YourVariable, Len(YourVariable - BeginMaxx)))

SamT
05-20-2015, 09:39 AM
Did you replace "YourVariable" with the name of the variable that you are using?

also put "Option Explicit" at the top of your code page. you can use VBA Options to set "Auto Syntax Check"