Hello,
In my userform I need to use the value of TextBox1 to recalculate/renumber a cell count. The problem also being that the data from this text box will be dynamically placed anywhere within column A.
Dim ws As Worksheet
Set ws = Worksheets("sheet3")
'This code works when selecting from a sheet
Dim cell As Range
'Sheets("Sheet3").Select
'For Each cell In Range("A12", Cells(Rows.Count, 1).End(xlUp))
'Sheets("Sheet1").Select
' If cell >= Range("D4") Then cell = cell + 1
'Next
'this doesnt work when selecting txtbox as range
Dim cell As Range
Sheets("Sheet3").Select
For Each cell In Range("A12", Cells(Rows.Count, 1).End(xlUp))
If cell >= Me.txtBox1.Value Then cell = cell + 1
Next
'Dim strPlace As String, strEmail As String
'Dim strSuggestion As String
Worksheets("Sheet1").Activate
strPlace = Me.txtBox1.Value
strEmail = Range("D5").Value
strSuggestion = Range("D6").Value
Worksheets("Sheet3").Activate
Range("A12").Activate
Do
If ActiveCell.Value = "" Then Exit Do
ActiveCell.Offset(1, 0).Activate
Loop
ActiveCell.Value = strPlace
ActiveCell.Offset(0, 1).Value = strEmail
ActiveCell.Offset(0, 2).Value = strSuggestion
I think I need to find a way ofturnong the textbox.value to a range then If cell >=The range of Me.txtBox1.Value Then cell = cell + 1
But I dont know how to get this cell count to work.
Anyhelp/advice would be great.
Thank-you very Much
Bookmarks