Line Created with Code Skips ahead when used
The Result of this Code is left in Cell T -- I copy the Formula Bar Version and insert it into a Word Document.
Other Blank Lines in the Document can be edited from the Border of the Document just by clicking within the line and the Cursor appears at the Left Border.
When I attempt to edit (add text) to the First Line in the Middle of the Document - The One Just after the inserted ---------------'s , I click within the Line and the Cursor Appears one Space Right of the Border. When I attempt to add my input text, the cursor and text move down one line to appear. I can edit and move it back up.
If I actually place the Cursor at the Border Space of the Line -- My Text appears on the Line Typed as Desired.
I cant find anything in my Word Layout thats causing it since its pasted in as a Block.
<b>Is there something in my Excel VBA Code that is Causing this line to not work as other blank lines inserted both Above and Below it do ?? </b>
If I attempt edit from within the Formula Bar -- Clicking with the line of OTHER blanks, places the cursor at the Left Border. When doing the same thing in the aforementioned line it too placed the cursor one space in but when adding text it does not drop down a line but it does move one space left, out to the border.
Puzzled. I have tried other combinations of Line Break and Insert Blank Line code but have not hit on anything that makes a difference.
As Always -- thanks for Looking --
The Result of this Code is left in Cell T -- I copy the Formula Bar Version and insert it into a Word Document.
Code:
Sub PrepOrders_From_T_2()
Dim LASTROW As Long
Dim MyCELL As Object
Dim i As Long
Dim rngT As Range
Application.ScreenUpdating = False
For Each MyCELL In Selection
If (MyCELL.Column = 20) Then
i = MyCELL.Row
Set rngT = Range("T" & i)
rngT.Value = Chr(10) & "Order Number:" & Space(1) & Range("A" & i) & Chr(10)
rngT.Value = rngT.Value & "Purchase Date:" & Space(1) & Range("C" & i) & Chr(10)
rngT.Value = rngT.Value & "Shipped By:" & Space(1) & Range("L" & i) & Chr(10) & Chr(13)
rngT.Value = rngT.Value & "Shipping Address:" & Chr(10)
rngT.Value = rngT.Value & Range("M" & i) & Chr(10)
rngT.Value = rngT.Value & Range("N" & i) & Chr(10)
' check if anything in donor column
If Range("O" & i) <> "" Then
rngT.Value = rngT.Value & Range("O" & i) & Chr(10)
End If
rngT.Value = rngT.Value & Range("P" & i) & "," & Range("Q" & i) & "."
rngT.Value = rngT.Value & Range("R" & i) & Chr(10)
rngT.Value = rngT.Value & Range("S" & i) & Chr(10) & Chr(10)
rngT.Value = rngT.Value & "Buyer Name:" & Space(1) & Range("F" & i) & Chr(10) & Chr(10) & Chr(10)
rngT.Value = rngT.Value & "Item:" & Space(1) & Range("H" & i) & Chr(10)
rngT.Value = rngT.Value & "SKU:" & Space(1) & Range("G" & i) & Chr(10)
rngT.Value = rngT.Value & "Quantity:" & Space(1) & Range("I" & i) & Chr(10)
'Problem in this area ?
rngT.Value = rngT.Value & "---------------------------------" & Chr(10) & Chr(13)
rngT.Value = rngT.Value & Chr(10) & "Order Number:" & Space(1) & Range("A" & i) & Chr(10)
'
rngT.Value = rngT.Value & "Purchase Date:" & Space(1) & Range("C" & i) & Chr(10)
rngT.Value = rngT.Value & "Shipped By:" & Space(1) & Range("L" & i) & Chr(10) & Chr(13) & Chr(10)
rngT.Value = rngT.Value & "Shipping Address:" & Chr(10)
rngT.Value = rngT.Value & Range("M" & i) & Chr(10)
rngT.Value = rngT.Value & Range("N" & i) & Chr(10)
' check if anything in donor column
If Range("O" & i) <> "" Then
rngT.Value = rngT.Value & Range("O" & i) & Chr(10)
End If
rngT.Value = rngT.Value & Range("P" & i) & "," & Range("Q" & i) & "."
rngT.Value = rngT.Value & Range("R" & i) & Chr(10)
rngT.Value = rngT.Value & Range("S" & i) & Chr(10)
rngT.Value = rngT.Value & "Buyer Name:" & Space(1) & Range("F" & i) & Chr(10) & Chr(10)
rngT.Value = rngT.Value & "Item:" & Space(1) & Range("H" & i) & Chr(10)
rngT.Value = rngT.Value & "Quantity:" & Space(1) & Range("I" & i) & Chr(10)
rngT.Value = rngT.Value & "SKU: " & Space(1) & Range("G" & i) & Chr(10)
rngT.Value = rngT.Value & "---------------------------------" & Chr(10) & Chr(13)
End If
Next MyCELL
ActiveCell.Font.Name = "Ariel"
Selection.RowHeight = 90
Selection.WrapText = True
Application.ScreenUpdating = True
End Sub
Other Blank Lines in the Document can be edited from the Border of the Document just by clicking within the line and the Cursor appears at the Left Border.
When I attempt to edit (add text) to the First Line in the Middle of the Document - The One Just after the inserted ---------------'s , I click within the Line and the Cursor Appears one Space Right of the Border. When I attempt to add my input text, the cursor and text move down one line to appear. I can edit and move it back up.
If I actually place the Cursor at the Border Space of the Line -- My Text appears on the Line Typed as Desired.
I cant find anything in my Word Layout thats causing it since its pasted in as a Block.
<b>Is there something in my Excel VBA Code that is Causing this line to not work as other blank lines inserted both Above and Below it do ?? </b>
If I attempt edit from within the Formula Bar -- Clicking with the line of OTHER blanks, places the cursor at the Left Border. When doing the same thing in the aforementioned line it too placed the cursor one space in but when adding text it does not drop down a line but it does move one space left, out to the border.
Puzzled. I have tried other combinations of Line Break and Insert Blank Line code but have not hit on anything that makes a difference.
As Always -- thanks for Looking --