+ Reply to Thread
Results 1 to 2 of 2

VB Help to Look at Next Row

  1. #1
    Registered User
    Join Date
    11-08-2005
    Posts
    2

    VB Help to Look at Next Row

    i created a formula in a cell that when populated returns values in certain fields.

    however my data is in a row and i need a macro that will look in say a2 return the value to a1, then print, then look at a3 return the value to a1 then print.

    does that sound doable?

    thanks,
    jason

  2. #2
    sebastienm
    Guest

    RE: VB Help to Look at Next Row

    Hi,
    Try the following:
    '----------------------------------
    Sub test()
    Dim wsh As Worksheet
    Dim rgDest As Range, cell As Range, rgFrom As Range

    Set wsh = ActiveSheet
    Set rgFrom = wsh.Range("A2:A10") 'Where to look
    Set rgDest = wsh.Range("A1") 'where to put the value

    'For each cell in rgFrom, set the value in rgDest and print
    For Each cell In rgFrom.Cells
    rgDest.Value = cell.Value
    wsh.PrintOut
    Debug.Print cell.Value
    Next
    End Sub
    '-------------------------------------------------------------------
    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "Jbucks007" wrote:

    >
    > i created a formula in a cell that when populated returns values in
    > certain fields.
    >
    > however my data is in a row and i need a macro that will look in say a2
    > return the value to a1, then print, then look at a3 return the value to
    > a1 then print.
    >
    > does that sound doable?
    >
    > thanks,
    > jason
    >
    >
    > --
    > Jbucks007
    > ------------------------------------------------------------------------
    > Jbucks007's Profile: http://www.excelforum.com/member.php...o&userid=28661
    > View this thread: http://www.excelforum.com/showthread...hreadid=483320
    >
    >


+ 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