last used row in column C equals last used row in column E

FROGGER24

New Member
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

shknbk2

Board Regular
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?

FROGGER24

New Member
if I understand your question correctly, the columns will be the same length

shknbk2

Board Regular
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)?

that is correct

shknbk2

Board Regular
Put this in the worksheet's code area.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
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

FROGGER24

New Member
thank you, the code worked fine.

FROGGER24

New Member
can the code be modified so it is a regular formula versus worksheet change event?

FROGGER24

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

shknbk2

Board Regular
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.

1,082,316
Messages
5,364,491
Members
400,802
Latest member
RichBRich

This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...