next empty cell

kevin lazell

Well-known Member
Joined
Jun 2, 2004
Messages
511
hi guys/gals
i have the following line of code.

sheets("sheet3").range("t"&rows.count).end(xlup).offset(1,0)=range("f12")

i have messed around with it but cant get it to work, basically what i am after is
column t is empty, the first time the code runs i want the value of f12 to go to cell t1
the next time it runs the value of f12 should go to cell t2 then t3 etc continuing to t10.
the line of code is in sheets 5 through to sheet 24 and i select any 10 of those 20 sheets
at random any help would be appreciated
thanks
kev
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Colin Legg

MrExcel MVP
Joined
Feb 28, 2008
Messages
3,497
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Kev,

Something like this should do the trick for you...

Code:
Sub foo()
 
    With Worksheets("Sheet3")
        If IsEmpty(.Range("T1")) Then
            .Range("T1").Value = Range("F12").Value
        Else
            .Range("T" & .Rows.Count).End(xlUp).Offset(1, 0).Value = Range("F12").Value
        End If
    End With
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,191,183
Messages
5,985,171
Members
439,944
Latest member
Vangelis74

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
Top