Find last Used Cell and more

chrismarek9

New Member
Joined
Mar 5, 2018
Messages
6
I have a sheet where the last row can be J79 or it can be J81 depending on options selected. I have a formula in J79, J80, and J81. I need a way to copy the last cell in this column, but it is not the last cell in the whole column of the sheet. Is there a way to define a range I'm looking for the last used cell??

I'm trying to make a quote page where options can make the final price come out on J79 or J81, then the final value cell needs to be copied and pasted to a different cell with in the sheet.

I cant get the first part to work correctly.

Sub FinalAdder()
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet


'Selecting the quote sheet
ActiveWorkbook.Sheets("Location Quote").Select

'supposed to find the last used cell after A78, before the next blank cell
Sheets("Location Quote").Range("A78").End(xlDown).Copy

'Pasting previous cell value to the next blank cell above J93
Sheets("Location Quote").Range("J93").End(xlUp).Offset(1).PasteSpecial xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
 
Try this instead:
Code:
[COLOR=#333333]Sub Te()[/COLOR]
[COLOR=#333333]If Sheets("Location Quote").Range("A81") = "" Then[/COLOR]
[COLOR=#333333]    InvAmt = Sheets("Location Quote").Range("A79")[/COLOR]
[COLOR=#333333]Else[/COLOR]
[COLOR=#333333]    InvAmt = Sheets("Location Quote").Range("A81")[/COLOR]
[COLOR=#333333]End If[/COLOR]

[COLOR=#333333]End Sub[/COLOR]
If that still doesn't work, then it is probably really not blank or empty, but has something like a space in it.
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,224,884
Messages
6,181,555
Members
453,053
Latest member
Kiranm13

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