Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default do loop until empty cell

I want to execute the following until the cell in Column E is EMPTY.

Range("E11").Select
ActiveCell.FormulaR1C1 = "=+jan!RC+jan!RC[2]" (where jan is the
'PREVIOUS' sheet
Range("G11:H11").Select
Selection.ClearContents
Range("E12").Select
ActiveCell.FormulaR1C1 = "=+éðåÃ*ø!RC+éðåÃ*ø!RC[2]"
Range("G12:H12").Select
Selection.ClearContents
Range("E13").Select

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default do loop until empty cell

RowCount = 11
do while Range("E" & RowCount) < ""
Range("E" & RowCount).FormulaR1C1 = "=+jan!RC+jan!RC[2]"
Range("G" & RowCount).ClearContents
Range("H" & RowCount).ClearContents

RowCount = RowCount + 1
loop

"Helmut" wrote:

I want to execute the following until the cell in Column E is EMPTY.

Range("E11").Select
ActiveCell.FormulaR1C1 = "=+jan!RC+jan!RC[2]" (where jan is the
'PREVIOUS' sheet
Range("G11:H11").Select
Selection.ClearContents
Range("E12").Select
ActiveCell.FormulaR1C1 = "=+éðåÃ*ø!RC+éðåÃ*ø!RC[2]"
Range("G12:H12").Select
Selection.ClearContents
Range("E13").Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default do loop until empty cell

With ActiveSheet

lastrow = .Cells(.Rows.Count, "E").End(xlUp).Row
.Range("E11").Resize(lastrow - 10).FormulaR1C1 = "=jan!RC+jan!RC[2]"
.Range("G11").Resize(lastrow - 10, 2).ClearContents
End With


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Helmut" wrote in message
...
I want to execute the following until the cell in Column E is EMPTY.

Range("E11").Select
ActiveCell.FormulaR1C1 = "=+jan!RC+jan!RC[2]" (where jan is the
'PREVIOUS' sheet
Range("G11:H11").Select
Selection.ClearContents
Range("E12").Select
ActiveCell.FormulaR1C1 = "=+éðåàø!RC+éðåàø!RC[2]"
Range("G12:H12").Select
Selection.ClearContents
Range("E13").Select



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop until cell is empty Ricky Pang Excel Programming 6 May 12th 06 05:14 PM
Loop to find next empty cell to the right not working. Casey[_84_] Excel Programming 3 May 4th 06 03:16 PM
having probelms getting my loop to terminate on an array value read from an empty cell mizcrab Excel Programming 3 November 30th 05 02:54 AM
Loop all sheetsand delete empty rows Sige Excel Programming 2 July 27th 05 12:22 PM
Empty cells in For Loop Linking to specific cells in pivot table Excel Programming 2 May 16th 05 07:25 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"