I want to add comments to certain name in column " C ", here's what I have so far. Please help me, what am I missing or doing wrong
Please Login or Register to view this content.
I want to add comments to certain name in column " C ", here's what I have so far. Please help me, what am I missing or doing wrong
Please Login or Register to view this content.
I didn't pinpoint why it didn't work, I just shuffled the code around until it worked.
The End(xlDown) will stop at the first empty cell in the column, maybe that was your problem. I assume you put the code in the form and not in an ordinary module, otherwise that will not work.
I can't seem to test yours. noting shows up or if I added text, the text in column c disappear.
I've uploaded the sample i want to use.
Oh as for the x1down, I took it off and used (c3:c800) which is the end of my sheet.
Attachment 182785
Ok, I added your code. It did what I want it to do and more. It delete everthing else in that column instead of leaving it as is.
Also, trying to understand how this works. Why we need the trn as range when we have Tmember as range already.
why do we use Debug.Print for textbox1 when textbox2 doesn't have one?
Debug.Print is a tool that I use to check that parts of the code do what I expect it to, I just forgot to delete it. It just prints to the Immediate window which is available in the VB editor. Feel free to delete that line.
The extra range Trng is just an intermediate step I added, also to make it easier to check the code. You could of course move that line to the start of the loop instead and skip the Trng but if I were you I would just leave it as it is.
The line below is what is deleting your cells. Since it was part of the code you posted I assumed that was what you wanted.
Just delete these two lines to solve that problem.
Please Login or Register to view this content.
I guess, my code was missing the .value.
My previous question about textbox1 and I didn't have to use .value at the end.
I wonder what was the different of using and not using.
Thanks everything works.
I will edit "solved" If above question get answer or 3 days over due, thanks Admin.
I don't think there is a difference between using .Value and not using it.
Range("A1").Value=888 means the same as Range("A1")=888.
When you skip the .value Excel assumes that's what you want anyway.
However, Value is just one of many properties of the object range. I think it's more correct and makes the code easier to read if I use .Value.
I'm pretty sure the same reasoning can be applied to the textbox object.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks