hi-
To the much appreciation of mudface and Russell, I was able to use a code in my project as follows:
Private Sub CommandButton3_Click()
For Each C In Worksheets("BALANCE SHEET").Range("D1:D10000") ' Adjust your range if necessary
If C.Value = DateForm.Calendar2.Value Then
C.End(xlToRight).Offset(0, 1).Value = TextBox1.Text
End If
Next C
End Sub
Im using the calendar control on a userform to seek a date on column "D" of a worksheet.
My request was how to write a code that will identify the first empty cell in that row(to the right of the date column)so that the text in textbox1 will be posted to that empty cell.
So this means that the text from textbox1 will be inserted into column "E" on the row that coresponds to the date that was chosen using the calander control(asuming that column "e" is empty).THIS WORKS GREAT!!
But heres the problem-
lets say I want to insert that same info from textbox1 to column "K" even though column "E:J" are empty. Now I know I can use the offset methode to change the numbers from (0, 1) to (0, 7), but then the code wont search for the next available cell if column "k" is nonempty- it will just replace the info! Help anyone please?
To the much appreciation of mudface and Russell, I was able to use a code in my project as follows:
Private Sub CommandButton3_Click()
For Each C In Worksheets("BALANCE SHEET").Range("D1:D10000") ' Adjust your range if necessary
If C.Value = DateForm.Calendar2.Value Then
C.End(xlToRight).Offset(0, 1).Value = TextBox1.Text
End If
Next C
End Sub
Im using the calendar control on a userform to seek a date on column "D" of a worksheet.
My request was how to write a code that will identify the first empty cell in that row(to the right of the date column)so that the text in textbox1 will be posted to that empty cell.
So this means that the text from textbox1 will be inserted into column "E" on the row that coresponds to the date that was chosen using the calander control(asuming that column "e" is empty).THIS WORKS GREAT!!
But heres the problem-
lets say I want to insert that same info from textbox1 to column "K" even though column "E:J" are empty. Now I know I can use the offset methode to change the numbers from (0, 1) to (0, 7), but then the code wont search for the next available cell if column "k" is nonempty- it will just replace the info! Help anyone please?