next empty cell

kevin lazell

Well-known Member
Joined
Jun 2, 2004
Messages
513
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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

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