+ Reply to Thread
Results 1 to 3 of 3

Dynamically Generated Range using Macro

  1. #1

    Dynamically Generated Range using Macro

    Hope someone can help me.

    I need to dynamically generate a range. The only value I know are the
    Columns (C to H); the row index is what needs to be dynamic.

    Example:
    ## - is the row index which will change from file to file.

    With Worksheets(ShtName).Range("C##:H##")
    .Merge across = True
    .Font.Bold = True
    .Font.Size = 10
    .Font.Italic = False
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlCenter
    .BorderAround ColorIndex:=1, Weight:=3
    .Interior.ColorIndex = 2
    .Value = "INSTRUCTIONS"
    End With

    If someone can help and needs more information, just drop me an email
    or reply.

    Thanks JM.EE01


  2. #2
    Ardus Petus
    Guest

    Re: Dynamically Generated Range using Macro

    Dim lRow as Long
    Dim lColumn as Long

    lRow = 10
    lColumn=20

    With Worksheets(ShtName).range("C" & lRow & ":H" & lColumn)
    .blah
    End With

    HTH
    --
    AP

    <[email protected]> a écrit dans le message de news:
    [email protected]...
    > Hope someone can help me.
    >
    > I need to dynamically generate a range. The only value I know are the
    > Columns (C to H); the row index is what needs to be dynamic.
    >
    > Example:
    > ## - is the row index which will change from file to file.
    >
    > With Worksheets(ShtName).Range("C##:H##")
    > .Merge across = True
    > .Font.Bold = True
    > .Font.Size = 10
    > .Font.Italic = False
    > .HorizontalAlignment = xlCenter
    > .VerticalAlignment = xlCenter
    > .BorderAround ColorIndex:=1, Weight:=3
    > .Interior.ColorIndex = 2
    > .Value = "INSTRUCTIONS"
    > End With
    >
    > If someone can help and needs more information, just drop me an email
    > or reply.
    >
    > Thanks JM.EE01
    >




  3. #3

    Re: Dynamically Generated Range using Macro

    Definitely did that trick! Many thanks especially for the speedy
    response.

    JM

    Ardus Petus wrote:
    > Dim lRow as Long
    > Dim lColumn as Long
    >
    > lRow =3D 10
    > lColumn=3D20
    >
    > With Worksheets(ShtName).range("C" & lRow & ":H" & lColumn)
    > .blah
    > End With
    >
    > HTH
    > --
    > AP
    >
    > <[email protected]> a =E9crit dans le message de news:
    > [email protected]...
    > > Hope someone can help me.
    > >
    > > I need to dynamically generate a range. The only value I know are the
    > > Columns (C to H); the row index is what needs to be dynamic.
    > >
    > > Example:
    > > ## - is the row index which will change from file to file.
    > >
    > > With Worksheets(ShtName).Range("C##:H##")
    > > .Merge across =3D True
    > > .Font.Bold =3D True
    > > .Font.Size =3D 10
    > > .Font.Italic =3D False
    > > .HorizontalAlignment =3D xlCenter
    > > .VerticalAlignment =3D xlCenter
    > > .BorderAround ColorIndex:=3D1, Weight:=3D3
    > > .Interior.ColorIndex =3D 2
    > > .Value =3D "INSTRUCTIONS"
    > > End With
    > >
    > > If someone can help and needs more information, just drop me an email
    > > or reply.
    > >
    > > Thanks JM.EE01
    > >



+ 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