finding the first available cell in the column to paste a value into

Pat_The_Bat

Board Regular
Joined
Jul 12, 2018
Messages
83
Trying to create a range variable that will be the next available cell in the column (after the last used cell in that column, or just below the last used cell in that column)
When I step through the code, I get an error on the line of code that begins "Set LSTROW= ....."

Can anyone help me get un-stuck on this?



Sub LSTROW()


Dim LSTROW As Range


Set LSTROW = Worksheets("Doc Checklist").Range("C2").End(xlDown).Row + 1










With Sheets("Doc Request").Range("B17:B100").SpecialCells(xlConstants)
.Offset(, -1).Copy LSTROW
'The line above this needs to reference range = the next available cell in the column C
End With
On Error Resume Next
Sheets("Doc Checklist").Range("C2:C100").SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0








End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Ok. Fluff closed your thread cause of double posting. So either we discuss it here, or move there:

https://www.mrexcel.com/forum/excel...st-creating-duplicates-final-output-list.html

After all I think we stick here as new point are still a part of the same project.

So.

1) You don't want to double copy the data already copied. Would some helper column be ok? You could place some mark in it. Then macro would check this column and skip rows with a mark. What do you think?

2) We need to do another macro for clearing "Doc Checklist" worksheet.
 
Upvote 0
@nardagus
As the Op has asked a new question and a new post has been started please continue on that thread, not this one.
Thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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