Find first blank cell in column K, on short term sheet

Rob_010101

Board Regular
Joined
Jul 24, 2017
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hello,

A simple one.

VBA Code:
Private Sub Workbook_Open()

    Dim wsCSP As Worksheet
    Set wsCSP = Sheets("CSP Tracking")
    
    Application.ScreenUpdating = False
    
        With wsCSP.[A1].CurrentRegion
                .AutoFilter 10, "<" & [Today()]
                .Offset(1).Resize(Rows.Count - 1).EntireRow.Delete
                .AutoFilter
        End With
        
        Worksheets("CSP Tracking").Range("L1").AutoFilter
                
    Application.ScreenUpdating = True
    
End Sub

The above code executes when excel is opened. When this is finished working, I need it to go to the "Short Term" sheet, look at column K and select the first available blank cell it finds.

I've tried to add this myself, but I can only get it to open the "Short Term" sheet on whatever cell was last selected on that sheet.

Kind Regards
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try this:

VBA Code:
Private Sub Workbook_Open()
  Dim wsCSP As Worksheet
  
  Set wsCSP = Sheets("CSP Tracking")
  Application.ScreenUpdating = False
  With wsCSP.[A1].CurrentRegion
    .AutoFilter 10, "<" & [Today()]
    .Offset(1).Resize(Rows.Count - 1).EntireRow.Delete
  End With
  Worksheets("CSP Tracking").Range("L1").AutoFilter
  
  Sheets("Short Term").Select
  Range("K1:K" & Range("K" & Rows.Count).End(3).Row + 1).Find("", Range("K1"), xlValues, xlWhole).Select
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
Try this:

VBA Code:
Private Sub Workbook_Open()
  Dim wsCSP As Worksheet
 
  Set wsCSP = Sheets("CSP Tracking")
  Application.ScreenUpdating = False
  With wsCSP.[A1].CurrentRegion
    .AutoFilter 10, "<" & [Today()]
    .Offset(1).Resize(Rows.Count - 1).EntireRow.Delete
  End With
  Worksheets("CSP Tracking").Range("L1").AutoFilter
 
  Sheets("Short Term").Select
  Range("K1:K" & Range("K" & Rows.Count).End(3).Row + 1).Find("", Range("K1"), xlValues, xlWhole).Select
  Application.ScreenUpdating = True
End Sub
Yes, this works.

Thanks very much :)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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