+ Reply to Thread
Results 1 to 3 of 3

Variable value from named cell

  1. #1
    Robert
    Guest

    Variable value from named cell

    I need to enhance the following code from JE Mcgimpsey (if not mistaken). nt.
    The 4992 is to be made variable, ie. value from a cell named RowCount
    which has the formula =Rows().

    Dim i As Long
    For i = 2 To 4992 Step 26
    Cells(i, 18).Resize(1, 30).Value = _
    Cells(i + 25, 18).Resize(1, 30).Value
    Next i
    End Sub

    Any assistance will be appreciated.
    Thank you
    --
    Robert

  2. #2
    Norman Jones
    Guest

    Re: Variable value from named cell

    Hi Robert,

    Try:

    Dim i As Long
    For i = 2 To Range("RowCount").Value Step 26
    Cells(i, 18).Resize(1, 30).Value = _
    Cells(i + 25, 18).Resize(1, 30).Value
    Next i

    ---
    Regards,
    Norman



    "Robert" <bobbell@discussions.microsoft.com> wrote in message
    news:F14D8AE5-26F2-4D45-8B12-94D407DB6DE6@microsoft.com...
    >I need to enhance the following code from JE Mcgimpsey (if not mistaken).
    >nt.
    > The "4992" is to be made variable, ie. value from a cell named "RowCount"
    > which has the formula "=Rows()".
    >
    > Dim i As Long
    > For i = 2 To 4992 Step 26
    > Cells(i, 18).Resize(1, 30).Value = _
    > Cells(i + 25, 18).Resize(1, 30).Value
    > Next i
    > End Sub
    >
    > Any assistance will be appreciated.
    > Thank you
    > --
    > Robert




  3. #3
    Robert
    Guest

    Re: Variable value from named cell

    Thank you Norman. Have tested and incorporated.
    --
    Robert




+ 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