Move to the last cell in a specific column

sofas

Active Member
Joined
Sep 11, 2022
Messages
494
Office Version
  1. 2019
Platform
  1. Windows
Hi I have a column with formulas that fetch data from another sheet . What is required is to move to the last cell with a fetched value I tried to put this code but it specifies all cells for me I want to move to the last cell only

VBA Code:
Sub Select_logic()
Dim myRng As Range
Set myRng = Range("C4", Range("c" & Rows.Count).End(4)).SpecialCells(xlCellTypeFormulas, 2)
myRng.Select
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
Try
VBA Code:
Sub select_Last()
  Columns("C").Find(What:="*", LookIn:=xlValues, SearchDirection:=xlPrevious).Select
End Sub
 
Upvote 1
Solution
I found this code but it only works when I find text, how can I modify it to work with both numbers and texts?

VBA Code:
Sub Select_logic()
Dim myRng As Range
Set myRng = ActiveSheet.Range("C4", Range("c" & Rows.Count).End(4)).SpecialCells(xlCellTypeFormulas, 2)
With myRng
myRng.Cells(myRng.Rows.Count, 1).Select
End With
 
Upvote 0

Forum statistics

Threads
1,216,225
Messages
6,129,601
Members
449,520
Latest member
TBFrieds

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