Error With Finding Last Row holding data in a Column

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have this line of code in which I am trying to find the last row in which data exists within a column. Pretty simple concept, but my method is leaving me with an error. I think it may be just a matter of failing to adapt a line of borrowed code to my particular needs.

Code:
lrw_lst = ws_lists.Cells(ws_lists.Rows.Count, ws_lists.Columns(mcol)).End(xlUp).Row

results in a type mismatch error.

lrw_lst is decalred as long.
mcol = 17
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Maybe
VBA Code:
lrw_lst = ws_lists.Cells(ws_lists.Rows.Count, mcol).End(xlUp).Row
 
Upvote 0
Solution
Yeah!!! Thanks Fluff, that was indeed the fix.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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