I have coded a userform that enters data into the next available blank row but if there is a formula in that row then it wont enter it in that row, I would like to add data to rows that also contain formulas that produce a blank result. Here is the current code that I am using:
Thankyou in advance.lRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row
Deb.
Last edited by dlhslim; 06-12-2011 at 02:09 AM.
Maybe:
Dim lngLastRow As Long lngLastRow = Cells.Find("*", LookIn:=xlValues, SearchDirection:=xlPrevious).Row + 1
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Hi Dom,
Thanks for your code, however it still entered the data into the next row that didn't contain a formula, but I want it to add it to the next row that does contain a formula. The formula is in Column A & my data is entered into Columns B & onwards.
Rather than checking column A for the last row can you not check B then?
Row = ws.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
No worries.
I assume you know that isn't an integral part of the code, just a method of spreading long lines of code onto more than one line to make them easier to read?
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks