RE: how to transfer data from sheet to sheet with new range?

Giganews Newsgroups
Subject: RE: how to transfer data from sheet to sheet with new range?
Posted by:  Gary''s Student
Date: Sun, 19 Aug 2007

Sub xfr_data()
Dim r As Range
Set r1 = Sheets("Sheet1").Range("A1:D1")
For i = 1 To Rows.Count
    n = Application.WorksheetFunction.CountA(Range(Cells(i, 1), Cells(i, 4)))
    If n = 0 Then
        Set r2 = Sheets("Sheet2").Cells(i, 1)
        r1.Copy r2
        Exit Sub
    End If
Next
End Sub

Run the macro after you have entered data in Sheet1

--
Gary''s Student - gsnu200738

"Jon" wrote:

> Greeting
> I have a work book with two sheets. Sheet 1 is for entering data with range
> from a1to d1. in sheet 2, I need the range in sheet 1 to be transferred to
> a1:d1. What I want to do is when entering data in sheet 1, the data transfer
> to sheet 2 and if there is a data in the above rang, a new range is setting
> for the new data.
> thanks

Replies

In response to

how to transfer data from sheet to sheet with new range? posted by Jon on Sun, 19 Aug 2007