Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Add line and text

I need to create code to place text 2 lines below the total. The total line
is one space below the data. I never know how many lines will be used as
this changes each month and for each file.
The text needs to go into clomun E.
Sched Prin
curt prin
int on curt
net sched int
prepayment penalty
losses and recoveries
stop advances
misc remit adjust

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Add line and text

Assume you mean two blank rows, then the text:

With cells(rows.count,"E").End(xlup)(4)

.Value = _
"Sched Prin" & chr(10) & "curt prin" & chr(10) & _
"int on curt" & chr(10) & "net sched int" & chr(10) & _
"prepayment penalty" & chr(10) & "losses and recoveries" & _
chr(10) & "stop advances" & chr(10) & _
"misc remit adjust"
.WrapText = True
.EntireRow.Autofit
End With

--
Regards,
Tom Ogilvy

"jln via OfficeKB.com" wrote:

I need to create code to place text 2 lines below the total. The total line
is one space below the data. I never know how many lines will be used as
this changes each month and for each file.
The text needs to go into clomun E.
Sched Prin
curt prin
int on curt
net sched int
prepayment penalty
losses and recoveries
stop advances
misc remit adjust

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Add line and text

Sub ABC()

With Cells(Rows.Count, "E").End(xlUp)(4)

.Resize(8, 1).Value = _
Application.Transpose(Split( _
"Sched Prin" & Chr(10) & _
"curt prin" & Chr(10) & _
"int on curt" & Chr(10) & _
"net sched int" & Chr(10) & _
"prepayment penalty" & Chr(10) & _
"losses and recoveries" & Chr(10) & _
"stop advances" & Chr(10) & _
"misc remit adjust", Chr(10)))
End With
End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote:

Assume you mean two blank rows, then the text:

With cells(rows.count,"E").End(xlup)(4)

.Value = _
"Sched Prin" & chr(10) & "curt prin" & chr(10) & _
"int on curt" & chr(10) & "net sched int" & chr(10) & _
"prepayment penalty" & chr(10) & "losses and recoveries" & _
chr(10) & "stop advances" & chr(10) & _
"misc remit adjust"
.WrapText = True
.EntireRow.Autofit
End With

--
Regards,
Tom Ogilvy

"jln via OfficeKB.com" wrote:

I need to create code to place text 2 lines below the total. The total line
is one space below the data. I never know how many lines will be used as
this changes each month and for each file.
The text needs to go into clomun E.
Sched Prin
curt prin
int on curt
net sched int
prepayment penalty
losses and recoveries
stop advances
misc remit adjust

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Add line and text

Thanks again Tom for the help.

Tom Ogilvy wrote:
Sub ABC()

With Cells(Rows.Count, "E").End(xlUp)(4)

.Resize(8, 1).Value = _
Application.Transpose(Split( _
"Sched Prin" & Chr(10) & _
"curt prin" & Chr(10) & _
"int on curt" & Chr(10) & _
"net sched int" & Chr(10) & _
"prepayment penalty" & Chr(10) & _
"losses and recoveries" & Chr(10) & _
"stop advances" & Chr(10) & _
"misc remit adjust", Chr(10)))
End With
End Sub

Assume you mean two blank rows, then the text:

[quoted text clipped - 22 lines]
stop advances
misc remit adjust


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Add line and text

Tom what would be the best way to theses 3 appear with red text?

"losses and recoveries"
"stop advances"
"misc remit adjust"


Tom Ogilvy wrote:
Sub ABC()

With Cells(Rows.Count, "E").End(xlUp)(4)

.Resize(8, 1).Value = _
Application.Transpose(Split( _
"Sched Prin" & Chr(10) & _
"curt prin" & Chr(10) & _
"int on curt" & Chr(10) & _
"net sched int" & Chr(10) & _
"prepayment penalty" & Chr(10) & _
"losses and recoveries" & Chr(10) & _
"stop advances" & Chr(10) & _
"misc remit adjust", Chr(10)))
End With
End Sub

Assume you mean two blank rows, then the text:

[quoted text clipped - 22 lines]
stop advances
misc remit adjust


--
Message posted via http://www.officekb.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Add line and text

Im sorry tom i need each them to go into their own cell.

Tom Ogilvy wrote:
Assume you mean two blank rows, then the text:

With cells(rows.count,"E").End(xlup)(4)

.Value = _
"Sched Prin" & chr(10) & "curt prin" & chr(10) & _
"int on curt" & chr(10) & "net sched int" & chr(10) & _
"prepayment penalty" & chr(10) & "losses and recoveries" & _
chr(10) & "stop advances" & chr(10) & _
"misc remit adjust"
.WrapText = True
.EntireRow.Autofit
End With

I need to create code to place text 2 lines below the total. The total line
is one space below the data. I never know how many lines will be used as

[quoted text clipped - 8 lines]
stop advances
misc remit adjust


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Add line and text

Here's a slight variation on Tom's excellent idea:

Sub Demo()
Dim M As Variant
M = Array( _
"Sched Prin", _
"Curt Prin", _
"Int on Curt", _
"Net Sched Int", _
"Prepayment Penalty", _
"Losses and Recoveries", _
"Stop Advances", _
"Misc Remit Adjust")

Cells(Rows.Count, "E").End(xlUp)(4). _
Resize(UBound(M) + 1) = WorksheetFunction.Transpose(M)

End Sub

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"jln via OfficeKB.com" <u25956@uwe wrote in message
news:6954f3d7ca848@uwe...
Im sorry tom i need each them to go into their own cell.

Tom Ogilvy wrote:
Assume you mean two blank rows, then the text:

With cells(rows.count,"E").End(xlup)(4)

.Value = _
"Sched Prin" & chr(10) & "curt prin" & chr(10) & _
"int on curt" & chr(10) & "net sched int" & chr(10) & _
"prepayment penalty" & chr(10) & "losses and recoveries" & _
chr(10) & "stop advances" & chr(10) & _
"misc remit adjust"
.WrapText = True
.EntireRow.Autofit
End With

I need to create code to place text 2 lines below the total. The total
line
is one space below the data. I never know how many lines will be used
as

[quoted text clipped - 8 lines]
stop advances
misc remit adjust


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200611/1



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Worksheet Functions 7 October 7th 09 11:10 AM
add diagonal line with text on each side of line tcallander Excel Discussion (Misc queries) 1 March 26th 09 03:45 PM
A 2 line text showing up in the Cell in Excel prints in 1 line Danny Excel Discussion (Misc queries) 6 July 12th 05 08:47 PM
Reading a text file line by line Foss[_2_] Excel Programming 4 March 16th 05 04:01 PM
import huge text file line-by-line? rachel Excel Programming 2 November 6th 04 04:43 PM


All times are GMT +1. The time now is 08:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"