Last row from another sheet

wmtsub

Active Member
Joined
Jun 20, 2018
Messages
322
Thought this would give me the last row in another worksheet of my work book,It does not.
Please - why not?

LR = Sheet("Pob").Cells(sht.Rows.Count, "D").End(xlUp).Row
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I don't think that "sht" reference should be in there.
Try:
Code:
LR = Sheet("Pob").Cells(Rows.Count, "D").End(xlUp).Row[/COLOR]

Note that this is giving your the last row with data in column D on the "Pob" sheet.
Make sure column D is the right column to use for this determination.
 
Upvote 0
I get an error still Sub or funtion not defined.
Would being a table make a differance?
 
Last edited:
Upvote 0
I get an error still Sub or funtion not defined.
Would being a table make a differance?

Change Sheet to Sheets

Like this:
Code:
LR = Sheets("Pob").Cells(Rows.Count, "D").End(xlUp).Row
 
Last edited:
Upvote 0

Forum statistics

Threads
1,222,691
Messages
6,167,670
Members
452,131
Latest member
MichelleH77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top