+ Reply to Thread
Results 1 to 2 of 2

Formatting Excel within ActiveX script

  1. #1
    Registered User
    Join Date
    04-05-2006
    Posts
    1

    Formatting Excel within ActiveX script

    I am creating an excel report from within a DTS package using the ActiveX script.

    I have an excel file that contains column names across the top (A1:AB1). -- I would like these to be bold.

    Then from A2:wherever the data ends I would like to have different color background on the alternating rows (if A2:AB2 is white, I'd like A3:AB3 to be grey, and so on)

    Does anyone have any code for this?
    Thanks,
    Ninel

  2. #2
    ExcelRater
    Guest

    Re: Formatting Excel within ActiveX script

    I'm not all that familiar with ActiveX, but this is how you would do
    that in VBA:

    Sub ApplyShading()
    n = 0
    ActiveSheet.UsedRange.Rows.Select
    For Each VisRow In Selection.Resize(,
    1).SpecialCells(xlCellTypeVisible)
    n = n + 1
    If n Mod 2 = 0 Then
    VisRow.EntireRow.Interior.ColorIndex = 15
    End If
    Next VisRow
    Rows("1:1").Select
    Selection.Font.Bold = True
    End Sub

    ninel wrote:
    > I am creating an excel report from within a DTS package using the
    > ActiveX script.
    >
    > I have an excel file that contains column names across the top
    > (A1:AB1). -- I would like these to be bold.
    >
    > Then from A2:wherever the data ends I would like to have different
    > color background on the alternating rows (if A2:AB2 is white, I'd like
    > A3:AB3 to be grey, and so on)
    >
    > Does anyone have any code for this?
    > Thanks,
    > Ninel
    >
    >
    > --
    > ninel
    > ------------------------------------------------------------------------
    > ninel's Profile: http://www.excelforum.com/member.php...o&userid=33202
    > View this thread: http://www.excelforum.com/showthread...hreadid=530209



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1