+ Reply to Thread
Results 1 to 2 of 2

Copy a single cell to a cell in a range

  1. #1
    Registered User
    Join Date
    07-10-2005
    Location
    Atlanta
    Posts
    20

    Copy a single cell to a cell in a range

    I'm an old COBOL programmer trying to port an ancient Quattro (DOS) application to Excel, converting the Quattro macro to Excel VBA. There are only a few kinds of operations I need to reproduce in VBA. The first one is this:

    I want to copy the value in a single cell to a particular cell in a named range.
    The single cell is named "In_pop" in a sheet named Input.
    The range is named "C_pop" and is in cells A4:A1151 in a sheet named Target.
    The position of the target cell in C_pop is in a cell named ThisWeek in Target

    If this were COBOL, the relevant code would be:
    01 In_pop pic 9(5).
    01 C_pop_array.
    05 C_pop pic 9(5) occurs 1148.
    01 ThisWeek pic 9(5) value 862.
    . . . . .
    Move In_pop to C_pop (ThisWeek)

    I would be grately deepful for any assistance.

    Tim Carr

  2. #2
    Chip Pearson
    Guest

    Re: Copy a single cell to a cell in a range

    Try something like

    Sub AAA()
    Range("In_Pop").Copy destination:=Range("ThisWeek")
    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com





    "Carrfamily"
    <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > I'm an old COBOL programmer trying to port an ancient Quattro
    > (DOS)
    > application to Excel, converting the Quattro macro to Excel
    > VBA. There
    > are only a few kinds of operations I need to reproduce in VBA.
    > The
    > first one is this:
    >
    > I want to copy the value in a single cell to a particular cell
    > in a
    > named range.
    > The single cell is named "In_pop" in a sheet named Input.
    > The range is named "C_pop" and is in cells A4:A1151 in a sheet
    > named
    > Target.
    > The position of the target cell in C_pop is in a cell named
    > ThisWeek in
    > Target
    >
    > If this were COBOL, the relevant code would be:
    > 01 In_pop pic 9(5).
    > 01 C_pop_array.
    > 05 C_pop pic 9(5) occurs 1148.
    > 01 ThisWeek pic 9(5) value 862.
    > . . . .
    > Move In_pop to C_pop (ThisWeek)
    >
    > I would be grately deepful for any assistance.
    >
    > Tim Carr
    >
    >
    > --
    > Carrfamily
    > ------------------------------------------------------------------------
    > Carrfamily's Profile:
    > http://www.excelforum.com/member.php...o&userid=25088
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=385994
    >




+ 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