Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() for rw = 1 to range("A65500").End(xlUp).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next "tlee" wrote in message ... Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Patrick, Thanks for your message first. But, it is not respond. Can help again? tlee for rw = 1 to range("A65500").End(xlUp).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next "tlee" wrote in message ... Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 1.go to the development environment - press and hold ALT then press F11 2. from the menu click "INSERT" then "MODULE" 3. type SUB DEMO 4. paste into the sub the code i gave to you 5. EITHER (a) press F5 OR (b) go back to the work sheet. select Tools / Macro /Macros , select Demo from the list and click "Run" "tlee" wrote in message ... Hi Patrick, Thanks for your message first. But, it is not respond. Can help again? tlee for rw = 1 to range("A65500").End(xlUp).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next "tlee" wrote in message ... Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Partick, Thanks for you help again!!! It is because it takes time for check the column A. As the result, I cannot see the result immediately. So, I changed End(xlup) to End(xldown). Likes: for rw = 1 to range("A65500").End(xldown).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next Then I can see the action promptly. Thanks tlee 1.go to the development environment - press and hold ALT then press F11 2. from the menu click "INSERT" then "MODULE" 3. type SUB DEMO 4. paste into the sub the code i gave to you 5. EITHER (a) press F5 OR (b) go back to the work sheet. select Tools / Macro /Macros , select Demo from the list and click "Run" "tlee" wrote in message ... Hi Patrick, Thanks for your message first. But, it is not respond. Can help again? tlee for rw = 1 to range("A65500").End(xlUp).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next "tlee" wrote in message ... Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() but xlDown stops at the first blank cell in A. I deliberately used xlUp to cover all blanks "tlee" wrote in message ... Hi Partick, Thanks for you help again!!! It is because it takes time for check the column A. As the result, I cannot see the result immediately. So, I changed End(xlup) to End(xldown). Likes: for rw = 1 to range("A65500").End(xldown).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next Then I can see the action promptly. Thanks tlee 1.go to the development environment - press and hold ALT then press F11 2. from the menu click "INSERT" then "MODULE" 3. type SUB DEMO 4. paste into the sub the code i gave to you 5. EITHER (a) press F5 OR (b) go back to the work sheet. select Tools / Macro /Macros , select Demo from the list and click "Run" "tlee" wrote in message ... Hi Patrick, Thanks for your message first. But, it is not respond. Can help again? tlee for rw = 1 to range("A65500").End(xlUp).Row if cells(rw,1)="" then cells(rw,"D")= cells(rw,"D") + 1 next "tlee" wrote in message ... Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Maybe this Sub Marine() Dim MyRange As Range Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row Set MyRange = Range("A1:A" & Lastrow) For Each c In MyRange If c.Value < "" Then c.Offset(, 3).Value = c.Offset(, 3).Value + 1 End If Next End Sub Mike "tlee" wrote: Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Mike, Thanks for your message and help !!! tlee Maybe this Sub Marine() Dim MyRange As Range Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row Set MyRange = Range("A1:A" & Lastrow) For Each c In MyRange If c.Value < "" Then c.Offset(, 3).Value = c.Offset(, 3).Value + 1 End If Next End Sub Mike "tlee" wrote: Dear all, Could anyone help how do I loop to check cells of column A if there is not empty, then add 1 to cell of column D and stop until the cell of column A is empty? Thanks for your help. tlee |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need the formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date | Excel Discussion (Misc queries) | |||
Need Formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date | Excel Discussion (Misc queries) | |||
Putting check marks in every cell in a column? | Excel Worksheet Functions | |||
check active cell column | Excel Programming |