SOLVED

Enter Value in Next Blank Cell

Copper Contributor

So i have

 

Dim NewRow As Integer
Dim WS As Sheet1
Set WS = Sheets("DashBoard")
NewRow = WS.Cells(WS.Rows.Count, "B").End(xlUp).Row + 1

WS.Cells(NewRow, 2).Value = TextBox.Value

 

I want it to check the first cell in Row B2 if its empty if so then Drop one row down and check again if empty then .value = TextBox.Value

 

if someone can help i was looking but nothing i can find.

4 Replies
From your code it seems you are checking for next blank cell in column L but your question related to B2 cell. Do you want to put value to B2 cell? Your question is not clear.

Actually that's not clear either so i have (data in B1) B2,B3 are empty that is where i want data to go.
B4 has data in it with this script i have it puts .Value in B5 but i want the data to go into B2 and B3

 

LightningWolf_1-1678628439200.png

 

@Harun24HR 

best response confirmed by LightningWolf (Copper Contributor)
Solution

@LightningWolf 

Perhaps

    Dim WS As Worksheet
    Dim NewCell As Range
    Set WS = Worksheets("DashBoard")
    Set NewCell = WS.Range("B4").End(xlUp).Offset(1)
    NewCell.Value = TextBox.Value
that did work thanks
1 best response

Accepted Solutions
best response confirmed by LightningWolf (Copper Contributor)
Solution

@LightningWolf 

Perhaps

    Dim WS As Worksheet
    Dim NewCell As Range
    Set WS = Worksheets("DashBoard")
    Set NewCell = WS.Range("B4").End(xlUp).Offset(1)
    NewCell.Value = TextBox.Value

View solution in original post