• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

fill the empty column cell in the last row used

Hi Ryan, and welcome to the forum! :awesome:

Like this?
Code:
Sub LastCell()
ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Offset(0, 1).Value = "ryan"
End Sub
 
That code will add the word ryan to cell G3 right? What if i added another row? Is it still the same?
The code that you provided. Is that the code that i need to put in the command button? Because i am going to use a textbox.

And another thing, let say the last column with value is g3. And the next row to that, the last cell column that has a value is f4. Now will it going to add the value to g4?

Thanks in advance.
 
Last edited:
Best way is to experiment with what's given ;)
Code:
Sub xllastusedrow()
Dim rnglastused As Range
Set rnglastused = Cells.Find(What:="*", After:=[A1], LookIn:=xlFormulas, Searchorder:=xlByRows, Searchdirection:=xlPrevious)
MsgBox "Last used row in this sheet is: " & rnglastused.Address
rnglastused.Offset(0, 1).Value = "LastCell"
End Sub
 
In addition to experimenting, it would be better if you gave more examples of what you want to happen, rather than just a one off. Lots of ways to make a value appear in G4...
 
Ok. It is a tracker.
1. Press the add button at the top. Then all txtbox, combobox and buttons will enable.
2. Fill in the form. And if done( no more additional info) press save button(diskett icon). It will show the time in the end time column and all the info in the worksheet.
3. The second button is for add comment. Let say i press the button at the top, i fill in the form, and i need to add additional comment. it will clear only the comment box. It will save the first comment and the other info to the worksheet except for the end time.
Will type in the empty comment box, then press the third button. if i press the third button it should add only the comment to the next empty cell column in the last used row. (This is what i asked last time).
Note: user can only add comment the maximum of 20. If done adding the comment, user will press the save button(diskette icon). Since the first info has been added, what i want is it will only add the time at the end time column in the worksheet. And everything will be cleared and back to the beginning.

Another thing is that. I also want to calculate the total time. End time - start time. I tried to use the code that you provided. Its adding the comment right next tothe row after the end time. Since what i did is i formatted the entire column of the total time.

I would really appreciate your help with this. Thanks in advance.
 
Back
Top