This code changes my rather than the line below it that needs changed

Nlhicks

Board Regular
Joined
Jan 8, 2021
Messages
244
Office Version
  1. 365
Platform
  1. Windows
This line of code will take the values in wsUpdate.Range and write the results in the header row of wsUpdate instead of the line that needs to be updated.
lngLastRow = wsUpdate.Range("A" & wsUpdate.Rows.Count).End(xlUp).Row

This line of code does nothing but we were trying to find a solution.
lngLastRow = WorksheetFunction.Max(wsUpdate.Range("A" & wsUpdate.Rows.Count).End(xlUp).Row, 2)

Does anyone have a suggestion that will fix this issue?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try
lngLastRow = wsUpdate.Range("A" & wsUpdate.Rows.Count).End(xlUp).Row+1
 
Upvote 0
Okay so what that did is change the very first line of code but my data does not live on the very first line of code it lives on a line somewhere between A2:A685. Once the data is filtered then it lives on the the second line but it is not actually the second line it is the only visible line.
 
Upvote 0
It's impossible for me to fathom the issue without seeing the full code, a sample of your data, and a full explanation of what you're trying to achieve. If this is just a follow up to another post then perhaps a link to that would do.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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