@Alan,
Citi has PMed me 4 times now. It seems he copies his post an puts it in a PM. Here is his last PM.
cili didn't get that I called him Chilly, knowing that was wrong as he called me Alan and Martin in past posts.
@ cili
The code I gave you needs to be broken down to understand. It was:
Cells(9,"L") = Cells(Rows.Count,"A").End(xlUp).Row
1. The stuff on the left of the "=" sign is replaced by the stuff on the right of the equal sign.
2. Cells(9,"L") is one of the many ways of refereeing to L2 or Range("L9"). I prefer to use the Cells(Row,Column) notation in my VBA code.
3. Rows.Count is the very last row number in your sheet. It is different for earlier versions of Excel.
4. The End(xlUp) is the same as pressing a Ctrl+UpArrow key combination.
5. The final ".Row" returns the row where the cursor stops after moving up.
The big picture of my code you might understand is this in words.
Put in cell I9 the row number of going down the bottom of the A column and the press Ctrl+Up arrow keys. This would be the first non blank it hit, or the bottom entry in column A.
NOW - You said my code didn't work as it gave back the number 1. My assumption is then that you have nothing in Column A!!!!! Try putting something in the cell A5 and do the code again and it should put a 5 is I9.
After looking at the copy and paste that Alan did above it looks like you need to change the "A" in my formula to the column letter that has the most stuff in it. Perhaps this code will do what you want.
Cells(9,"L") = Cells(Rows.Count,"B").End(xlUp).Row
OH - and please stop PMing me too. I read all recent questions I answer to insure there aren't add-on questions, so PMing me is not needed. Did you know we work for free? It is completely on our own that we decide to help others. Sometimes we don't want to give fish to people who don't want to learn how to fish. <get it?> <I knew your name was cili and I still owe you one more wrong name>
Bookmarks