Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
Hello
I'm guessing this isn't allowed but I'd welcome confirmation Can one concatenate a variable into a VBA command So for example instead of userform1. windowsmediaplayer1.controls.currentposition could you have userform1. windowsmediaplayer & ("range a1") & .controls.currentposition If so what would the correct syntax be? Many thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
In WHICH group do you want an answer?
-- Don Guillett Microsoft MVP Excel SalesAid Software "teepee" wrote in message ... Hello I'm guessing this isn't allowed but I'd welcome confirmation Can one concatenate a variable into a VBA command So for example instead of userform1. windowsmediaplayer1.controls.currentposition could you have userform1. windowsmediaplayer & ("range a1") & .controls.currentposition If so what would the correct syntax be? Many thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
"Don Guillett" wrote in message ... In WHICH group do you want an answer? err this one? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
Then try your solution and post back -- Don Guillett Microsoft MVP Excel SalesAid Software "teepee" wrote in message ... "Don Guillett" wrote in message ... In WHICH group do you want an answer? err this one? |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
"Don Guillett" wrote in message ... Then try your solution and post back compile error: method or data member not found and it highlights the words ".windowsmediaplayer" |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
To test I have the following macro, where cell a1 contains the value 1
Sub test () dim value as long value = userform1.windowsmediaplayer & range ("a1") & ..controls.currentposition 'value = userform1.windowsmediaplayer1controls.currentposit ion msgbox value end sub when I hash out the third line and unhash the fourth it successfully return the messagebox value zero. Most grateful if anyone can tell me if (a) I'm wasting my time with this approach or (b) the correct syntax |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
Try it this way
Sub test () dim value as long value = userform1.windowsmediaplayer" & range ("a1") & ".controls.currentposition 'value = userform1.windowsmediaplayer1controls.currentposit ion msgbox value end sub -- Don Guillett Microsoft MVP Excel SalesAid Software "teepee" wrote in message ... To test I have the following macro, where cell a1 contains the value 1 Sub test () dim value as long value = userform1.windowsmediaplayer & range ("a1") & .controls.currentposition 'value = userform1.windowsmediaplayer1controls.currentposit ion msgbox value end sub when I hash out the third line and unhash the fourth it successfully return the messagebox value zero. Most grateful if anyone can tell me if (a) I'm wasting my time with this approach or (b) the correct syntax |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
Thanks Don
It reports a syntax error however "Don Guillett" wrote in message ... Try it this way Sub test () dim value as long value = userform1.windowsmediaplayer" & range ("a1") & ".controls.currentposition 'value = userform1.windowsmediaplayer1controls.currentposit ion msgbox value end sub -- Don Guillett Microsoft MVP Excel SalesAid Software "teepee" wrote in message ... To test I have the following macro, where cell a1 contains the value 1 Sub test () dim value as long value = userform1.windowsmediaplayer & range ("a1") & .controls.currentposition 'value = userform1.windowsmediaplayer1controls.currentposit ion msgbox value end sub when I hash out the third line and unhash the fourth it successfully return the messagebox value zero. Most grateful if anyone can tell me if (a) I'm wasting my time with this approach or (b) the correct syntax |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. -- Pecoflyer ------------------------------------------------------------------------ Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=24214 |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
"Don Guillett" wrote in message ... I don't use many userforms but try this sadly that returns the information as a text string "userform1. windowsmediaplayer1.controls.currentposition" rather than as a value. |
#12
Posted to microsoft.public.excel.misc
|
|||
|
|||
concatenation question
"Pecoflyer" wrote in message ... Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. Apologies I'm using outlook express today which doesn't seem to do such things |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenation | Excel Discussion (Misc queries) | |||
Help with Concatenation | Excel Worksheet Functions | |||
Concatenation | Excel Worksheet Functions | |||
Concatenation question | Excel Worksheet Functions | |||
Concatenation Help | Excel Worksheet Functions |