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
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,920
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top