Use the Row or Column property of the cell to get the row or column number. Then use
this in the Rows property of the sheet:

 LastRow = ActiveSheet.Rows.SpecialCells(xlLastCell, xlErrors + xlLogical + xlNumbers
+ xlTextValues).Row
 Rows(LastRow).Font.Bold = True

or more concisely:

Rows(ActiveSheet.Rows.SpecialCells(xlLastCell, xlErrors + xlLogical + xlNumbers +
xlTextValues).Row).Font.Bold = True



Sergei Stenkov wrote:

> John Mason wrote:
>
> > The VBA code for setting properties for the whole row or column is:
> > Columns("G:G").Font.Bold = True
> > Rows("21"21").Font.Bold = True
> >
> > Sergei Stenkov wrote:
> >
> > > Hello,
> > >
> > > Does anyone know how to access Excel row/column from Delphi 5.
> > > I need to change the content of a row/col's font to bold
> > (say for totals)
> > > and need to be able to do it in one go, not cell by cell
>
> Thanks John and I'm sorry I wasn't more precise in questions.
>
> I actually don't know what row or column I'll need to set to bold.
> The "bold" rows' and column's numbers supposed to be calculated from the
> last cell.
> I can get it using:
>
> xlSheet.Rows.SpecialCells(xlLastCell,
> xlErrors+xlLogical+xlNumbers+xlTextValues)
>
> This, returns a range containing the last cell with the data and allows to
> bold that last cell:
>
> xlSheet.Rows.SpecialCells(
>         xlLastCell, xlErrors+xlLogical+xlNumbers+xlTextValues).Font.Bold := True;
>
> But I don't know if I can get row/col info out of it.
>
> So, the question should've been:
> How do I get row/col numbers out of the result of the above mentioned
> function (range)?
> or
> Is there another way to select row/col?
>
> Could not find a proper function in VBA so far.
>
> Thank you,
> Sergei
>
> ---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"

--
John Mason



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to