copy and paste

Rocket Red

New Member
Joined
Nov 22, 2005
Messages
3
I have text, which I want to copy from one application to another.
The problem is the text areas are different sizes

The text area in Form A is much larger than in Form B.

Text from Form A
This is a sample of text, which has to be copied from Form A to Form B
However the text in Form B can only be pasted within a certain area which does not exceed
32 characters.
There is no limit to how many lines of text there might be nor the area they will be copied from.

Text from Form A
12345678901234567890123456789012
THIS IS A SAMPLE OF TEXT, WHICH HAS
TO BE COPIED FROM FORM A TO FORM
B. HOWEVER THE TEXT IN FORM B CAN
ONLY BE PASTED WITHIN A CERTAIN
AREA WHICH DOES NOT EXCEED 32
CHARACTERS.
THERE IS NO LIMIT TO HOW MANY LINES
OF TEXT THERE MIGHT BE NOR THE
AREA THEY WILL BE COPIED FROM.

I have a macro, which changes Lower Case to Upper Case from a selected area but as to copying and pasting it
within a certain area I’m not sure if this can be done although I do have vb code that counts letters
I

Sub UpperCaseCellSelection()
Dim Cell As RANGE
For Each Cell In Selection.Cells
If Cell.HasFormula = False Then
Cell = UCase(Cell)
End If
Next
End Sub



Any help would be appreciated

Thanks RR
 

Rocket Red

New Member
Joined
Nov 22, 2005
Messages
3
No takers then

I should have previewed it first.
This is what it should look like.
If a word doen't fit in a new line is to be taken.

12345678901234567890123456789012
THIS IS A SAMPLE OF TEXT, WHICH
HAS TO BE COPIED FROM FORM A TO
FORM B. HOWEVER THE TEXT IN FORM
B CAN ONLY BE PASTED WITHIN A
A CERTAIN REA WHICH DOES NOT
EXCEED 32 CHARACTERS.
 

Rocket Red

New Member
Joined
Nov 22, 2005
Messages
3
Still looking for an answer:
Found this on another forum, similiar problem only in word.
Can I convert this to excel

Carriage return after 78 characters or in my case 32.








Sub ForceTo78()
Const cstrPunct As String = "!%*)}]:;>,."
Dim rngChar As Range

For Each rngChar In ActiveDocument.Words
If rngChar.Information(wdFirstCharacterColumnNumber) > 77 Then
If InStr(1, cstrPunct, Left(rngChar, 1), _
vbTextCompare) = 0 Then rngChar.InsertParagraphBefore
End If
Next rngChar
End Sub
 

Forum statistics

Threads
1,078,005
Messages
5,337,689
Members
399,160
Latest member
Vantone

Some videos you may like

This Week's Hot Topics

Top