lorraine
08-02-2008, 03:18 AM
Hello,
I would like to create a function that copy cell C1 into column B until ther is a value in column A.
I then stop copying, until it find a new vaue in column C.
To make it clearer I have attached a spreadsheet, sheet2 shows the desired results, sheet1 is the original spreadsheet.
I have tried to write te beginning of my fonction but i am not sure how to finish it and if it is right. Can you help me ? Thanks
What I have so far :
Function Copy (rng As Range)
Dim xl As Application, r1 As Range, r2 As Range, i As Integer
Set xl = Application
If IsEmpty(rng.Offset(-1)) Then
Set r1 = rng
Else
Set r1 = rng.End(xlUp)
End If
If IsEmpty(r1.Offset(1)) Then
Set r2 = r1
Else
Set r2 = r1.End(xlDown)
I would like to create a function that copy cell C1 into column B until ther is a value in column A.
I then stop copying, until it find a new vaue in column C.
To make it clearer I have attached a spreadsheet, sheet2 shows the desired results, sheet1 is the original spreadsheet.
I have tried to write te beginning of my fonction but i am not sure how to finish it and if it is right. Can you help me ? Thanks
What I have so far :
Function Copy (rng As Range)
Dim xl As Application, r1 As Range, r2 As Range, i As Integer
Set xl = Application
If IsEmpty(rng.Offset(-1)) Then
Set r1 = rng
Else
Set r1 = rng.End(xlUp)
End If
If IsEmpty(r1.Offset(1)) Then
Set r2 = r1
Else
Set r2 = r1.End(xlDown)