|
-
Nov 16th, 2011, 08:21 AM
#1
Thread Starter
Member
Help me with my doubts ???
1. Creating a new Excel using an existing VBA.( create a new file in directory,Saving the existing file in the a directory and saving it as some other file in a directory)-separate codes are needed.
2. Function for splitting numbers. ( opposite of concatenate fn.)
i.e. If i have a number 123 it should get split into individual digits ( 1,2 and 3 )
3.Opening a new application using an excel vba ( opening mozilla firefox )
4.The user form should remember the values entered previously.
-
Nov 16th, 2011, 11:03 AM
#2
Member
Re: Help me with my doubts ???
Hi there,
Well for the first question you can use a shell command like the following:
Code:
Program = "C:\Program Files\KeditW\KEDITW32.exe c:\Temp\Book1.prn (PROFILE CLEANUP"
TaskID = Shell(Program, 1)
For the second question, it depends on the amount of numbers you have welded or concatenated together. If its just three then thats simple use the following:
Code:
=right(A2,1)
=left(A2,1)
=mid"(A2,2,1)
With your last question it is something I have not attempted myself but I seem to remember something about declaring public variables
-
Nov 16th, 2011, 11:37 AM
#3
Thread Starter
Member
Re: Help me with my doubts ???
thank you mate....but Does the above codes work in vba ???
i want it to be a macros function.....
esp 2nd one.. " = right(a2,1) " this is used in excel isn't it. direct function of excel
-
Nov 16th, 2011, 11:41 AM
#4
Thread Starter
Member
Re: Help me with my doubts ???
Also 1 more Query..
I have a big bunch of codes built in the user forum under a command button control..but i have to make this program into different modules so that it is easily understandable..how can make it....I don't to how to declare it...even if i declare it is displaying a Object Error.,
i think the module couldn't access the objects placed in my user forum....
how to create these things into different modules....
-
Nov 17th, 2011, 05:40 AM
#5
Re: Help me with my doubts ???
for 2) if the number can be an unknown length the above codes are only for 3 digit, so try like
vb Code:
Function splitnum(num) As Variant Dim myarr() As Variant ReDim myarr(Len(num) - 1) For i = 1 To Len(num) myarr(i - 1) = Mid(num, i, 1) Next splitnum = myarr End Function Sub test() s = splitnum(465656456) End Sub
i think the module couldn't access the objects placed in my user forum....
objects on the form must be prefixed with the form name
like userform1.textbox1
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|