output to excel question

output to excel question

am 23.10.2007 19:40:07 von BobH

Hi,
I have this code in the groupheader_print section of an AccessXP
report. What is the code to 'Bold' the text288 cell.
thanks
bobh.

'this is the rpting category header
wks.Cells(row, 1) = Me.Text288

'move the active cell down one row
row = row + 1

Re: output to excel question

am 23.10.2007 20:03:28 von Davidb

On Oct 23, 1:40 pm, bobh wrote:
> Hi,
> I have this code in the groupheader_print section of an AccessXP
> report. What is the code to 'Bold' the text288 cell.
> thanks
> bobh.
>
> 'this is the rpting category header
> wks.Cells(row, 1) = Me.Text288
>
> 'move the active cell down one row
> row = row + 1

I think you need to set the formatting of the excel worksheet within
excel.

Re: output to excel question

am 23.10.2007 21:09:33 von Phil Stanton

Here is a bit of code

With MyXL.Application
If .Worksheets(i).Name <> SheetName Then ' Name changed
.Worksheets(i).Name = SheetName
End If
.Worksheets(i).Activate
.Range("A1:Q100").Clear
.Range("A1:Q100").Font.Size = FontSize10_9
.Range("A1:Q100").Font.Bold = False
'.Range("A1:Q6").Font.Name = "Arial"
'.Range("A7:Q100").Font.Name = "Arial Narrow" ' To make more room
.Range("A1:Q100").Font.Name = "Arial"
.Range("H7:Q100").Font.Name = "Arial Narrow" ' Race Results To
make more room

.Cells(1, 1).Font.Size = FontSize14_12
.Cells(1, 1).Font.Color = 255
.Cells(1, 1).Font.Bold = True
.Cells(1, 1).Value = "Overall Results " & Frm!SeriesName
End With

May be of help
Phil
"DavidB" wrote in message
news:1193162608.630135.89520@i13g2000prf.googlegroups.com...
> On Oct 23, 1:40 pm, bobh wrote:
>> Hi,
>> I have this code in the groupheader_print section of an AccessXP
>> report. What is the code to 'Bold' the text288 cell.
>> thanks
>> bobh.
>>
>> 'this is the rpting category header
>> wks.Cells(row, 1) = Me.Text288
>>
>> 'move the active cell down one row
>> row = row + 1
>
> I think you need to set the formatting of the excel worksheet within
> excel.
>

Re: output to excel question

am 23.10.2007 21:36:40 von BobH

This --> .Cells(1, 1).Font.Bold = True <-- was exactly what I was
looking for

Thanks :)
bobh.

On Oct 23, 3:09 pm, "Phil Stanton" wrote:
> Here is a bit of code
>
> With MyXL.Application
> If .Worksheets(i).Name <> SheetName Then ' Name changed
> .Worksheets(i).Name = SheetName
> End If
> .Worksheets(i).Activate
> .Range("A1:Q100").Clear
> .Range("A1:Q100").Font.Size = FontSize10_9
> .Range("A1:Q100").Font.Bold = False
> '.Range("A1:Q6").Font.Name = "Arial"
> '.Range("A7:Q100").Font.Name = "Arial Narrow" ' To make more room
> .Range("A1:Q100").Font.Name = "Arial"
> .Range("H7:Q100").Font.Name = "Arial Narrow" ' Race Results To
> make more room
>
> .Cells(1, 1).Font.Size = FontSize14_12
> .Cells(1, 1).Font.Color = 255
> .Cells(1, 1).Font.Bold = True
> .Cells(1, 1).Value = "Overall Results " & Frm!SeriesName
> End With
>
> May be of help
> Phil"DavidB" wrote in message
>
> news:1193162608.630135.89520@i13g2000prf.googlegroups.com...
>
>
>
> > On Oct 23, 1:40 pm, bobh wrote:
> >> Hi,
> >> I have this code in the groupheader_print section of an AccessXP
> >> report. What is the code to 'Bold' the text288 cell.
> >> thanks
> >> bobh.
>
> >> 'this is the rpting category header
> >> wks.Cells(row, 1) = Me.Text288
>
> >> 'move the active cell down one row
> >> row = row + 1
>
> > I think you need to set the formatting of the excel worksheet within
> > excel.- Hide quoted text -
>
> - Show quoted text -

Re: output to excel question

am 23.10.2007 21:55:55 von BobH

Any example of what 'alignment' looks like??
I tried
..Cells(1, 1).Alignment = Center ;nope
..Cells(1, 1).Alignment.Center = True ; nope

bobh.

On Oct 23, 3:09 pm, "Phil Stanton" wrote:
> Here is a bit of code
>
> With MyXL.Application
> If .Worksheets(i).Name <> SheetName Then ' Name changed
> .Worksheets(i).Name = SheetName
> End If
> .Worksheets(i).Activate
> .Range("A1:Q100").Clear
> .Range("A1:Q100").Font.Size = FontSize10_9
> .Range("A1:Q100").Font.Bold = False
> '.Range("A1:Q6").Font.Name = "Arial"
> '.Range("A7:Q100").Font.Name = "Arial Narrow" ' To make more room
> .Range("A1:Q100").Font.Name = "Arial"
> .Range("H7:Q100").Font.Name = "Arial Narrow" ' Race Results To
> make more room
>
> .Cells(1, 1).Font.Size = FontSize14_12
> .Cells(1, 1).Font.Color = 255
> .Cells(1, 1).Font.Bold = True
> .Cells(1, 1).Value = "Overall Results " & Frm!SeriesName
> End With
>
> May be of help
> Phil"DavidB" wrote in message
>
> news:1193162608.630135.89520@i13g2000prf.googlegroups.com...
>
>
>
> > On Oct 23, 1:40 pm, bobh wrote:
> >> Hi,
> >> I have this code in the groupheader_print section of an AccessXP
> >> report. What is the code to 'Bold' the text288 cell.
> >> thanks
> >> bobh.
>
> >> 'this is the rpting category header
> >> wks.Cells(row, 1) = Me.Text288
>
> >> 'move the active cell down one row
> >> row = row + 1
>
> > I think you need to set the formatting of the excel worksheet within
> > excel.- Hide quoted text -
>
> - Show quoted text -

Re: output to excel question

am 23.10.2007 23:55:03 von Chuck Grimsby

..HorizontalAlignment = xlCenter

If you're using late binding, replace xlCenter with -4108.


By the way, recording a macro in Excel, which creates a VBA macro in
Excel, and then examining that macro is the fastest way to find out
how to do something in Excel. (Most of the time anyways...)


On Tue, 23 Oct 2007 12:55:55 -0700, bobh wrote:

>Any example of what 'alignment' looks like??
>I tried
>.Cells(1, 1).Alignment = Center ;nope
>.Cells(1, 1).Alignment.Center = True ; nope
>
>bobh.
>
>On Oct 23, 3:09 pm, "Phil Stanton" wrote:
>> Here is a bit of code
>>
>> With MyXL.Application
>> If .Worksheets(i).Name <> SheetName Then ' Name changed
>> .Worksheets(i).Name = SheetName
>> End If
>> .Worksheets(i).Activate
>> .Range("A1:Q100").Clear
>> .Range("A1:Q100").Font.Size = FontSize10_9
>> .Range("A1:Q100").Font.Bold = False
>> '.Range("A1:Q6").Font.Name = "Arial"
>> '.Range("A7:Q100").Font.Name = "Arial Narrow" ' To make more room
>> .Range("A1:Q100").Font.Name = "Arial"
>> .Range("H7:Q100").Font.Name = "Arial Narrow" ' Race Results To
>> make more room
>>
>> .Cells(1, 1).Font.Size = FontSize14_12
>> .Cells(1, 1).Font.Color = 255
>> .Cells(1, 1).Font.Bold = True
>> .Cells(1, 1).Value = "Overall Results " & Frm!SeriesName
>> End With
>>
>> May be of help
>> Phil"DavidB" wrote in message
>>
>> news:1193162608.630135.89520@i13g2000prf.googlegroups.com...
>>
>>
>>
>> > On Oct 23, 1:40 pm, bobh wrote:
>> >> Hi,
>> >> I have this code in the groupheader_print section of an AccessXP
>> >> report. What is the code to 'Bold' the text288 cell.
>> >> thanks
>> >> bobh.
>>
>> >> 'this is the rpting category header
>> >> wks.Cells(row, 1) = Me.Text288
>>
>> >> 'move the active cell down one row
>> >> row = row + 1
>>
>> > I think you need to set the formatting of the excel worksheet within
>> > excel.- Hide quoted text -
>>
>> - Show quoted text -
>

Please Post Any Replies To This Message Back To the Newsgroup.
There are "Lurkers" around who can benefit by our exchange!

Re: output to excel question

am 24.10.2007 00:04:15 von Phil Stanton

With MyXL.Application
.Columns("A").ColumnWidth = 7 ' Position
.Range("A9:A100").Font.Bold = True
.Columns("B").ColumnWidth = 20 ' Boat name
.Columns("C").ColumnWidth = ColumnWidth10_9 ' Sail No
If Frm!ResultTypeIDRelay = 1 Then ' Combined
.Columns("D").ColumnWidth = ColumnWidth10_9 ' Division
.Columns("D").HorizontalAlignment = xlRight ' Right
ElseIf Frm!ResultTypeIDRelay = 2 Then ' Division
.Columns("D").ColumnWidth = 0 ' Division
ElseIf Frm!ResultTypeIDRelay = 4 Then ' Boat Class
.Columns("D").ColumnWidth = ColumnWidth10_9 ' Division
.Columns("D").HorizontalAlignment = xlRight ' Right
End If
.Columns("E").ColumnWidth = 6 ' Club
.Columns("F").ColumnWidth = 6 ' Total Points
.Columns("G").ColumnWidth = 6 ' Total Ex Discards
.Columns("G").Font.Bold = True ' Total Ex Discards
.Columns("H").ColumnWidth = ColumnWidths8Quart_7Quart ' Races
.Columns("I").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("J").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("K").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("L").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("M").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("N").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("O").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("P").ColumnWidth = ColumnWidths8Quart_7Quart
.Columns("Q").ColumnWidth = ColumnWidths8Quart_7Quart
.Range("F7:G8").HorizontalAlignment = xlRight ' right
.Range("H7:Q100").HorizontalAlignment = xlCenter ' center
.Range("H7:Q100").Font.Color = 16711680 ' blue
.Cells(2, 1).Font.Size = FontSize14_12
.Cells(2, 1).Font.Color = 255
.Cells(2, 1).Font.Bold = True

More bits

Phil
"bobh" wrote in message
news:1193169355.500856.44820@i13g2000prf.googlegroups.com...
> Any example of what 'alignment' looks like??
> I tried
> .Cells(1, 1).Alignment = Center ;nope
> .Cells(1, 1).Alignment.Center = True ; nope
>
> bobh.
>
> On Oct 23, 3:09 pm, "Phil Stanton" wrote:
>> Here is a bit of code
>>
>> With MyXL.Application
>> If .Worksheets(i).Name <> SheetName Then ' Name changed
>> .Worksheets(i).Name = SheetName
>> End If
>> .Worksheets(i).Activate
>> .Range("A1:Q100").Clear
>> .Range("A1:Q100").Font.Size = FontSize10_9
>> .Range("A1:Q100").Font.Bold = False
>> '.Range("A1:Q6").Font.Name = "Arial"
>> '.Range("A7:Q100").Font.Name = "Arial Narrow" ' To make more
>> room
>> .Range("A1:Q100").Font.Name = "Arial"
>> .Range("H7:Q100").Font.Name = "Arial Narrow" ' Race Results To
>> make more room
>>
>> .Cells(1, 1).Font.Size = FontSize14_12
>> .Cells(1, 1).Font.Color = 255
>> .Cells(1, 1).Font.Bold = True
>> .Cells(1, 1).Value = "Overall Results " & Frm!SeriesName
>> End With
>>
>> May be of help
>> Phil"DavidB" wrote in message
>>
>> news:1193162608.630135.89520@i13g2000prf.googlegroups.com...
>>
>>
>>
>> > On Oct 23, 1:40 pm, bobh wrote:
>> >> Hi,
>> >> I have this code in the groupheader_print section of an AccessXP
>> >> report. What is the code to 'Bold' the text288 cell.
>> >> thanks
>> >> bobh.
>>
>> >> 'this is the rpting category header
>> >> wks.Cells(row, 1) = Me.Text288
>>
>> >> 'move the active cell down one row
>> >> row = row + 1
>>
>> > I think you need to set the formatting of the excel worksheet within
>> > excel.- Hide quoted text -
>>
>> - Show quoted text -
>
>

Re: output to excel question

am 25.10.2007 18:15:13 von BobH

On Oct 23, 5:55 pm, Chuck Grimsby
wrote:
> .HorizontalAlignment = xlCenter
>
> If you're using late binding, replace xlCenter with -4108.
>
> By the way, recording a macro in Excel, which creates a VBA macro in
> Excel, and then examining that macro is the fastest way to find out
> how to do something in Excel. (Most of the time anyways...)
>
>
>
>
>
> On Tue, 23 Oct 2007 12:55:55 -0700, bobh wrote:
> >Any example of what 'alignment' looks like??
> >I tried
> >.Cells(1, 1).Alignment = Center ;nope
> >.Cells(1, 1).Alignment.Center = True ; nope
>
> >bobh.
>
> >On Oct 23, 3:09 pm, "Phil Stanton" wrote:
> >> Here is a bit of code
>
> >> With MyXL.Application
> >> If .Worksheets(i).Name <> SheetName Then ' Name changed
> >> .Worksheets(i).Name = SheetName
> >> End If
> >> .Worksheets(i).Activate
> >> .Range("A1:Q100").Clear
> >> .Range("A1:Q100").Font.Size = FontSize10_9
> >> .Range("A1:Q100").Font.Bold = False
> >> '.Range("A1:Q6").Font.Name = "Arial"
> >> '.Range("A7:Q100").Font.Name = "Arial Narrow" ' To make more room
> >> .Range("A1:Q100").Font.Name = "Arial"
> >> .Range("H7:Q100").Font.Name = "Arial Narrow" ' Race Results To
> >> make more room
>
> >> .Cells(1, 1).Font.Size = FontSize14_12
> >> .Cells(1, 1).Font.Color = 255
> >> .Cells(1, 1).Font.Bold = True
> >> .Cells(1, 1).Value = "Overall Results " & Frm!SeriesName
> >> End With
>
> >> May be of help
> >> Phil"DavidB" wrote in message
>
> >>news:1193162608.630135.89520@i13g2000prf.googlegroups.com. ..
>
> >> > On Oct 23, 1:40 pm, bobh wrote:
> >> >> Hi,
> >> >> I have this code in the groupheader_print section of an AccessXP
> >> >> report. What is the code to 'Bold' the text288 cell.
> >> >> thanks
> >> >> bobh.
>
> >> >> 'this is the rpting category header
> >> >> wks.Cells(row, 1) = Me.Text288
>
> >> >> 'move the active cell down one row
> >> >> row = row + 1
>
> >> > I think you need to set the formatting of the excel worksheet within
> >> > excel.- Hide quoted text -
>
> >> - Show quoted text -
>
> Please Post Any Replies To This Message Back To the Newsgroup.
> There are "Lurkers" around who can benefit by our exchange!- Hide quoted text -
>
> - Show quoted text -


That works, thanks :)