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

FROGGER24

New Member
Joined
Aug 17, 2019
Messages
10
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
Joined
Mar 5, 2016
Messages
235
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?
 

shknbk2

Board Regular
Joined
Mar 5, 2016
Messages
235
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)?
 

shknbk2

Board Regular
Joined
Mar 5, 2016
Messages
235
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
 

FROGGER24

New Member
Joined
Aug 17, 2019
Messages
10
thank you, the code worked fine.
 

FROGGER24

New Member
Joined
Aug 17, 2019
Messages
10
can the code be modified so it is a regular formula versus worksheet change event?
 

FROGGER24

New Member
Joined
Aug 17, 2019
Messages
10
i think the formula should look like this in B1 =if($C$1=0,c1&lr,(C1&LR =E1&lr)
 

shknbk2

Board Regular
Joined
Mar 5, 2016
Messages
235
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.
 

Forum statistics

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

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top