Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a used / filled rows
How can I write a sub-routine that will look for a row that is used /
filled. I.E. rows C1 to C8 are empty and it keep skipping the empty rows until it finds a row that is used / filled. In this case row C9 is used. *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a used / filled rows
Hi
Try this: Sub FindUsedRow() TargetCol = "C" If Range(TargetCol & "1").Value = "" Then UsedRow = Range(TargetCol & "1").End(xlDown).Row Else UsedRow = 1 End If Debug.Print UsedRow End Sub Regards, Per "ogopogo5" skrev i meddelelsen ... How can I write a sub-routine that will look for a row that is used / filled. I.E. rows C1 to C8 are empty and it keep skipping the empty rows until it finds a row that is used / filled. In this case row C9 is used. *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a used / filled rows
Hi Par
Thank you for taking your time in helping out. I copied and paste your FindUsedRow, however it doesn't work. I've left rows C1 to C8 empty. Is there someting else I should be doing? *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a used / filled rows
You need to look in the Immediate window to see the 9
Or add a message box Sub FindUsedRow() TargetCol = "C" If Range(TargetCol & "1").Value = "" Then UsedRow = Range(TargetCol & "1").End(xlDown).Row Else UsedRow = 1 End If MsgBox UsedRow Debug.Print UsedRow End Sub Gord Dibben MS Excel MVP On Thu, 09 Oct 2008 13:05:02 -0700, ogopogo5 wrote: Hi Par Thank you for taking your time in helping out. I copied and paste your FindUsedRow, however it doesn't work. I've left rows C1 to C8 empty. Is there someting else I should be doing? *** Sent via Developersdex http://www.developersdex.com *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a used / filled rows
Thank you Gord. It works.
However, I'm sorry I should of indicated at the and of my request; Once it has found the used / filled row, it will select that cell. Ogopogo5 *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
Print data filled rows only | Excel Worksheet Functions | |||
Exporting Only Filled Rows To Another Workbook | Excel Programming | |||
finding the no. of rows in a COL filled with numbers, zeros and bl | Excel Worksheet Functions | |||
Deleting rows filled with 0 | Excel Programming |