LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default VBA Font detail loss

In message of Sun, 20 Sep 2009
10:47:42 in microsoft.public.excel.programming, Bernie Deitrick
writes
If you have other font details that you want to apply


Ooops.... Hit send too soon!

.....you need to do that on a detail by detail basis.


Thanks to Joel , Bernie Deitrick
, Rick Rothstein
erizon.net for help. It took me a while to absorb the information.

(I had forgotten to mention I use Excel 2003.)

Joel's suggestion of POfInterest & .Cells(J, 2).copy _
destination:=POfInterest gave a syntax error. I am afraid I
could not figure what was intended.
Rick's suggestion of union frightened me as I had not used union before
and found a seemingly undocumented restriction that all arguments to
union must be on the same sheet.
So I took your work, Bernie, in creating this code which - ugly as it is
- does what I need. Somebody may propose some simplification ;)

Private Sub ExpandQuestion()
Dim I As Long
Dim J As Long
Dim K As Long
Dim L As Long
Dim SheetName As String
Dim Scratch As Range

For I = 1 To 4
SheetName = "3." & I
If InStr(ActiveCell, SheetName) Then
With Workbooks("foo.xls").Sheets(SheetName)
Set Scratch = .Cells(1, 14)
Scratch.Value = ActiveCell.Value
For J = 3 To 12
If .Cells(J, 1) = 0 Then Scratch.Value = _
Scratch.Value & .Cells(J, 2).Value _
& .Cells(J, 14).Value
Next
K = Len(ActiveCell.Value)
For J = 3 To 12
If .Cells(J, 1) = 0 Then
For L = 1 To Len(.Cells(J, 2))
K = K + 1
Scratch.Characters(Start:=K, _
Length:=1).Font.Bold = _
.Cells(J, 2).Characters(Start:=L, _
Length:=1).Font.Bold
Next
For L = 1 To Len(.Cells(J, 14))
K = K + 1
Scratch.Characters(Start:=K, _
Length:=1).Font.Bold = _
.Cells(J, 14).Characters(Start:=L, _
Length:=1).Font.Bold
Next
End If
Next
Scratch.WrapText = ActiveCell.WrapText
Scratch.Copy ActiveCell
End With
Exit For
End If
Next
End Sub

Thanks, again, for all the help. ;)
--
Walter Briscoe


 
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
hardship letter explaining devastating loss property loss financi carol Excel Discussion (Misc queries) 1 June 12th 09 02:13 PM
grab detail when = 1 jenn Excel Worksheet Functions 0 January 12th 06 09:06 PM
In Detail (what ever works please help) Teerings3[_6_] Excel Programming 3 December 12th 05 09:26 PM
Weight loss line chart to monitor weight loss progress S Fox Charts and Charting in Excel 6 November 8th 05 05:10 PM
Show detail Sunryzz Excel Worksheet Functions 0 May 5th 05 10:56 PM


All times are GMT +1. The time now is 07:36 AM.

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"