Find last used row in a column and offset by 2 columns

Eric12

New Member
Joined
Jun 11, 2018
Messages
9
I need some help with the code below. In column "A" I put in the date of a report I'm doing between ranges "A7:A33". I have a macro that looks for a certain value and it puts it in the next available row in column "N". On instances that the value is not found the cell will stay empty. What I'm trying to do is instead of inserting the value in the next available cell in column "N" I would like to find the last used row in range "A7:A33" and offset to column "N" to insert value.
Code:
If Sheets("Sheet1").Range("N7") = "" Then
    Sheets("Sheet1").Range("N7") = myValue1
Else
    Sheets("Sheet1").Range("N33").End(xlUp).Offset(1) = myValue1
End If
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Sorry thread name should be but I'm not sure how to edit.
[h=1]Find last used row in a column and offset to a different column.[/h]
 
Upvote 0
Try
Code:
Sheets("Sheet1").Range("A34").End(xlUp).Offset(1, 13) = myValue1
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,946
Members
449,275
Latest member
jacob_mcbride

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