# Thread: last used row in column C equals last used row in column E Thanks: 0 Likes: 0

1. ## last used row in column C equals last used row in column E

Hello everyone, I could use some help in finding last used rows. If C1 is >0, I need the last used row in column C to equal last used row in column E.

thanks  Reply With Quote

2. ## Re: last used row in column C equals last used row in column E

When do you want this to happen? Automatically whenever the value in C1 changes?

Let's say that C1 > 0 and that column C uses rows 1-15 and column E uses 1-10, do you simply want to delete C11-C15?

What if C uses rows 1-5? Do you want to add values to C6-C10?  Reply With Quote

3. ## Re: last used row in column C equals last used row in column E

if I understand your question correctly, the columns will be the same length  Reply With Quote

4. ## Re: last used row in column C equals last used row in column E

Are you asking to make sure that if C1 > 0, then set the value of C10 the same as E10 (assuming that these are the last cells in the columns)?  Reply With Quote

5. ## Re: last used row in column C equals last used row in column E

that is correct  Reply With Quote

6. ## Re: last used row in column C equals last used row in column E

Put this in the worksheet's code area.

Code:
```Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "\$C\$1" Then
If Target.Value > 0 Then
Cells(Rows.Count, 3).End(xlUp).Value = Cells(Rows.Count, 5).End(xlUp).Value
End If
End If
End Sub```  Reply With Quote

7. ## Re: last used row in column C equals last used row in column E

thank you, the code worked fine.  Reply With Quote

8. ## Re: last used row in column C equals last used row in column E

can the code be modified so it is a regular formula versus worksheet change event?  Reply With Quote

9. ## Re: last used row in column C equals last used row in column E

i think the formula should look like this in B1 =if(\$C\$1=0,c1&lr,(C1&LR =E1&lr)  Reply With Quote

10. ## Re: last used row in column C equals last used row in column E

I don't know what your values are in columns C & E, but to have a formula control the values, the cells in C have to be formulas.  Reply With Quote

## User Tag List

#### Tags for this Thread

column, equal, finding, row, rows #### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•