very intresting ....now this
Sub blah()
MyString = "2500 3542 1708 438"
x = Split(MyString, vbTab)
MsgBox x(0)
End Sub
I get one string with all the data
Now if I put x(1) I get error type mismatch ( it is actually OUT OF RANGE )
I used the loop routine you gave me, and the debug printed 9 to confirm that it is actually a tab seperator.
As for the source of data , it is NOT from the web. It is instrument reading copied to the clipboard. That is why I said there is no guessing what the data will look like. I know the data...
If I do this:
MyString = "111 222 333" ' using tab as seperator
x =Split(MyString,vbTab)
I created an error and the error routine kicks in with message "Date on clip board is not text....." the one I made in the error routine
To start with your first remark, it did not only work, but seperated each element into a seperate column, and by transposing it, problem solved. I love simple solutions , it is "hard" to come by.
As for your second approach, this will give me the driving seat, and I love to do it this way but I...
Sub GetClipBoardText()
Dim DataObj As MSForms.DataObject
'Dim r As Range 'this is just a trial, it did not work
'Set r = Range("b1:b???") ' unkown number of elements
Set DataObj = New MSForms.DataObject
On Error GoTo InvalidData
'~~> Get data from the clipboard...
Hold your horses Narayan....
Let us solve the first hurdle:
Total income per week is Package+Rental+Commission
The total of the 20 weeks has a target.
I need to calculate the variable commission.
Target - total Package-Rental = total commission needed to achieve the target
These are all shown on...
In the attached WB; the ONLY variable that I can play with is the commission.
I put some kind of formula and please ignore it.
The objective is to calculate the commission NEEDED to achieve the target(E23).
Marc L,
The macro worked. Thank you for taking the time to show me how it is done.
Since I have 50+ IN's I will modify it to loop through the bunch.
It is really funny, this solution has nothing to do with Excel. It could be ms word and it will still work.
This is a elegant solution.
There is...
Marc L,
The input file is IN.txt , the Macros should create the OUT.txt file.
Also , spacing is not important these lines(in the OUT.txt) will be part of a program that accept loose formatting of spaces.
I hope I answered your questions.
Hui,
Both macros worked like charm. This way I do not have to create ID for each key, the file IS the key.
I am ready to program my remote.
Thank Hui, I really hope I can do (one day !!!) what you are doing to the members of this forum.
You ARE star, guiding us and helping us to master this...
Hui,
Master piece of work.....
The Remote I am working on has about 50 such files (But I can create just one to join them all)
So, to automate it ; the VBA code must do :
1. Read the file
2. Dump each key data in a separate sheet ( 50 sheets)
3. Insert your magic formula into double the Rows...
The code is really not worth looking at, but here it is anyway
Sub Macro1()
'
' Macro1 Macro
'
'
Range("J1").Select
ActiveCell.FormulaR1C1 = "delayMicroseconds("
Range("A1").Select
Selection.Copy
ActiveSheet.Paste
Range("J1").Select
ActiveSheet.Paste
ActiveCell.FormulaR1C1 =...
I have csv file of n lines formatted as follows:
40600 usec, 3560 usec
1560 usec, 580 usec
260 usec, 580 usec ....etc
For EACH line I need to create TWO lines as follows:
delayMicroseconds(40600);
pulseIR(3560); ...etc
I tried to record a macro to start me off , but I failed to...
Nice work Faseeh, You took the approach that NT article used to explain the mechanics AND produced a tool.
The challenge is now to coordinate with the rest of us to nail this algorithm down.
I will spend sometime understanding what you did,and of course I will have questions, but let me do my...
Ref. to the calculator test runs observations:
1. If I use the SAME input say 3 and 3 for the same total.. Each time I use the calc,I get different results !!!!
2. The algorithm is relying on the fact that each selection is based on "invisible value system" by each player. Since I represent the...
Narayan,
You are on the right track.......I will do more and try to answer your 2 questions.
Do you have specific format in mind to provide you with calculation details digitally ??
My strategy is not working, because each one is actually looking for a DIFFERENT room ( no disagreement )
I need to create a situation where they are competing for the best room at the best price.
So I will pick 3 rooms, 2 same size but front and back ( the front is the ace) and one smaller...