|
Just an idea (which depends on the format of multiple selected cells).
Create a multi line input field where the content of all selected and copied cells can be inserted at once. Create a button that reads the input field content, splits it (depending on the separation characters provided by Excel when putting the data on the clipboard), and adds the items.
Excel puts the data in multiple formats to the clipboard but the form usually uses only the text format with line feed terminated rows and space (or tab?) separated columns. To check this just paste into any text editor.
|
|
|
|
|
Thanks for your answer.
I only have the raw data of Unique IDs so they don't have to be in excel can be in notepad or just pasted anywhere.
The IDs are being input into a Java Applet and must be added one ID at a time. So I need to copy Cell A1, Paste Into Applet & Press Tab and then copy Cell A2, Paste,Tab Repeat until all cells have been added into the applet.
The IDs are in excel but could be in a text file or just pasted into an application that could read all ids line by line input the text into the applet followed by tab key and repeat until there is no more lines to read.
As the applet input field is a text field I don't think any excel formatting of separating values will carry over from excel or a text file to the text field in the applet.
|
|
|
|
|
If the data are separated in some form (as text) and you are able to split them, then your applet should be able to iterate over the splitted data and perform the necessary operation on each item.
There will be some separating when Excel generates text to be put on the clipboard (or saved as text file; the default text file format used by Excel is TAB separation). When the cells did not contain spaces it should be always possible to split.
I understand that this might not be possible (especially when there may be multiple formats). Was just a suggestion.
|
|
|
|
|
Ok all values are free text so I will try and save as a text file, copy the cells and paste into the applet text input box and let you know how it goes
Will it matter if the IDs are in Cell A1, A2 or should they been in A1, B1 all on the same row?
|
|
|
|
|
Member 11097615 wrote: Will it matter if the IDs are in Cell A1, A2 or should they been in A1, B1 all on the same row?
Sorry, but I can't answer that because I did not know in which order they are copied and if the order is important. But if there is no specific relation between the cell position and the content just forget the Excel cell indexes.
|
|
|
|
|
Hi
I tried saving the workbook as Tab Delimited and just copy pasting into the input field in the Java Applet and it just pasted them all as the one string.
Recording a macro of copy alt tab and paste only recorded the keystrokes in excel nothing external.
I think maybe I will need to use auto it or autohotkey or something like that.
|
|
|
|
|
Let the Java applet split the string and perform the required operations on each item.
|
|
|
|
|
Unfortunately I have no control over the applet, I just have to work with it.
There seems to be a lot of examples of VB Excel Macros doing this to automate filling of forms but i'm not sure if the same can be done into an applet.
|
|
|
|
|
If you do not have the applet source then there is nothing you can do to automate this. Recording keystrokes in Excel to create macros does not mean you can then run those macros in other applications.
|
|
|
|
|
char c = 'a'
System.out.println(c++);
The response is also 'a' and I don't understand why.
thank a lot!
|
|
|
|
|
Because 'c' would be incremented after you print it. That's what the postfix operator does.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
|
if you put:
char c = 'a';
int d = c++;
System.out.println(d);
I get the same result: it is not happen nothing.
I don't understand why c is not incremented.
The result is 97 who is ascii code of 'a'.
I think that the result would be 97.
modified 17-Feb-17 6:38am.
|
|
|
|
|
Go to the link I give you in my reply above, and spend some useful time learning the Java language first.
|
|
|
|
|
int d = c++;
can be splitted into these two operations
int d = c;
c = c + 1;
You are using the postfix increment which means that the increment operation is performed after the assignment. This is contrary to the prefix increment:
int d = ++c;
c = c + 1;
int d = c;
|
|
|
|
|
yes , I understand.
char c = 'a';
c++;
int d = c;
System.out.println(d);
This si correct.
Yes, I forgot that this is 2 operations when I do = and ++ and the first operation is =.
thank you.
|
|
|
|
|
Because
char c = 'a'
System.out.println(c++);
translate to
char c = 'a'
System.out.println(c);
c++;
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Message Closed
modified 13-Feb-17 9:04am.
|
|
|
|
|
Java is a scary thing - you never know when Oracle will sue you using it...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
modified 13-Feb-17 11:37am.
|
|
|
|
|
I have edited your message to delete the spam address of the subject. I suppose you don't want to help them or to get your messaage reported as spam, do you?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
These forums are not provided for free advertising. If you have some interesting code to share then please see Submission Guidelines[^].
modified 13-Feb-17 11:38am.
|
|
|
|
|
I have edited your message to delete the spam address of the subject. I suppose you don't want to help them or to get your messaage reported as spam, do you?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Didn't realise I had included it; where was it?
|
|
|
|
|
In the subject... which automatically is "Re: original subject" and he had wrote the website in the subject. You can still see them in the search of his messages
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks, I obviously missed that.
|
|
|
|