Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Formatting Text to Italic AND Underlined to individually listed cells

I am trying to set the below listed cells to have the values displayed in
Italic AND Underlined.
Nothing seems to happen with the below???


ActiveSheet.Select
Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
Font.Italic = False
Font.Underline = True
Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"
End With


Did i miss something?
Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formatting Text to Italic AND Underlined to individually listedcells

If you want Italic, I would think that True would work better than False.

And watch your with/end with statements.

I bet you want something more like:

Option Explicit
Sub testme()

Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
.Font.Italic = True
.Font.Underline = True
End With

Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"

End Sub



Corey wrote:

I am trying to set the below listed cells to have the values displayed in
Italic AND Underlined.
Nothing seems to happen with the below???

ActiveSheet.Select
Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
Font.Italic = False
Font.Underline = True
Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"
End With

Did i miss something?
Corey....


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Formatting Text to Italic AND Underlined to individually listed cells

Thanks Dave.
I did have the Italic set to TRUE but i changed it back to FALSE to see if i
accedently had the entire sheet in italic.

"Dave Peterson" wrote in message
...
If you want Italic, I would think that True would work better than False.

And watch your with/end with statements.

I bet you want something more like:

Option Explicit
Sub testme()

Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
.Font.Italic = True
.Font.Underline = True
End With

Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"

End Sub



Corey wrote:

I am trying to set the below listed cells to have the values displayed in
Italic AND Underlined.
Nothing seems to happen with the below???

ActiveSheet.Select
Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
Font.Italic = False
Font.Underline = True
Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"
End With

Did i miss something?
Corey....


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formatting Text to Italic AND Underlined to individually listedcells

My bet is that you underlined/italicized different cells than you meant.

If you do this:

dim myRng as range
set myrng = range("b3")
'then use
with myrng
.range("b2").font.italic = true
'and more
end with

You're not formatting B2 of that worksheet, you're formatting the cell that
corresponds to the cell in myRng (B3 in my sample).

And activesheet.range("b3").range("B2") is the same as C4--it's one cell to the
right and one cell down.

That's why I moved the "End with" to its new location in the code.

Corey wrote:

Thanks Dave.
I did have the Italic set to TRUE but i changed it back to FALSE to see if i
accedently had the entire sheet in italic.

"Dave Peterson" wrote in message
...
If you want Italic, I would think that True would work better than False.

And watch your with/end with statements.

I bet you want something more like:

Option Explicit
Sub testme()

Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
.Font.Italic = True
.Font.Underline = True
End With

Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"

End Sub



Corey wrote:

I am trying to set the below listed cells to have the values displayed in
Italic AND Underlined.
Nothing seems to happen with the below???

ActiveSheet.Select
Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
Font.Italic = False
Font.Underline = True
Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"
End With

Did i miss something?
Corey....


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formatting Text to Italic AND Underlined to individually listedcells

This may be better:

You're not formatting B2 of that worksheet, you're formatting the cell that
corresponds to B2 if you assume the origin is myRng (B3 in my sample).

Instead of this:

You're not formatting B2 of that worksheet, you're formatting the cell that
corresponds to the cell in myRng (B3 in my sample).

Dave Peterson wrote:

My bet is that you underlined/italicized different cells than you meant.

If you do this:

dim myRng as range
set myrng = range("b3")
'then use
with myrng
.range("b2").font.italic = true
'and more
end with

You're not formatting B2 of that worksheet, you're formatting the cell that
corresponds to the cell in myRng (B3 in my sample).

And activesheet.range("b3").range("B2") is the same as C4--it's one cell to the
right and one cell down.

That's why I moved the "End with" to its new location in the code.

Corey wrote:

Thanks Dave.
I did have the Italic set to TRUE but i changed it back to FALSE to see if i
accedently had the entire sheet in italic.

"Dave Peterson" wrote in message
...
If you want Italic, I would think that True would work better than False.

And watch your with/end with statements.

I bet you want something more like:

Option Explicit
Sub testme()

Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
.Font.Italic = True
.Font.Underline = True
End With

Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"

End Sub



Corey wrote:

I am trying to set the below listed cells to have the values displayed in
Italic AND Underlined.
Nothing seems to happen with the below???

ActiveSheet.Select
Dim rng As Range
Set rng = Range("A1,B1,D1,F1,B2,E2,B3,C3,D3,E3,F3,G3,H3,I3")
With rng
Font.Italic = False
Font.Underline = True
Range("A1").Value = "Roll#"
Range("B1").Value = "Customer"
Range("D1").Value = "Date"
Range("F1").Value = "Belt Type"
Range("B2").Value = "ST Job No."
Range("E2").Value = "Inspectors Names"
Range("B3").Value = "Item No."
Range("C3").Value = "Section Length"
Range("D3").Value = "Width"
Range("E3").Value = "Belt Type"
Range("F3").Value = "Top Cover"
Range("G3").Value = "Bottom Cover"
Range("H3").Value = "Event Type"
Range("I3").Value = "Comments/Stamp Id's"
End With

Did i miss something?
Corey....

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Cannot save text wrapping in cells-must do individually Martha Excel Discussion (Misc queries) 1 January 14th 10 11:01 PM
Counting cells with text not listed. ladygr Excel Worksheet Functions 2 October 12th 07 09:38 PM
Lookup and change to italic italic Doug Excel Worksheet Functions 2 October 30th 06 01:39 PM
How to count the number of Excel cells with text formatted Italic phausman Excel Worksheet Functions 3 July 19th 06 04:32 PM
How can I detect if the text in a cell is underlined? plh Excel Programming 2 April 27th 06 02:42 AM


All times are GMT +1. The time now is 09:53 AM.

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

About Us

"It's about Microsoft Excel"