View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default how to transfer data from sheet to sheet with new range?

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