Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you copy a substr of text using VBA?
123456ABC7890 I know that I can use this to copy the entire cell Range("A1").Copy I want to copy "ABC" and that is it. I tried using "substr" combinations both they don't seem to work. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you actually need to get it into the clipboard?
If not Range("B9").Value = Mid(Range("A1").Value,7,3) if you need a string/text in the clipboard, see Chip Pearson's page on the DataObject http://www.cpearson.com/excel/clipboar.htm -- Regards, Tom Ogilvy "DTHMTL" wrote in message ... Can you copy a substr of text using VBA? 123456ABC7890 I know that I can use this to copy the entire cell Range("A1").Copy I want to copy "ABC" and that is it. I tried using "substr" combinations both they don't seem to work. Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry I mean "mid", I was thinking VFP
"DTHMTL" wrote in message ... Can you copy a substr of text using VBA? 123456ABC7890 I know that I can use this to copy the entire cell Range("A1").Copy I want to copy "ABC" and that is it. I tried using "substr" combinations both they don't seem to work. Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
is the value you want always at the same position?. If yes use Tom's solution. If not you may provide some more details which substring you want to get (that is what logic has to be applied) -- Regards Frank Kabel Frankfurt, Germany DTHMTL wrote: Can you copy a substr of text using VBA? 123456ABC7890 I know that I can use this to copy the entire cell Range("A1").Copy I want to copy "ABC" and that is it. I tried using "substr" combinations both they don't seem to work. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
How copy format, font, color and border without copy/paste? | Excel Programming | |||
"Substr" command in Query | Excel Programming |