LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default question on setting Range

I cant for the life of me figure out how to do this.

I'll attach a sample of the code that i've written so far, just for a
better idea of what i'm talking about.

Basically I would like this bit to count the number of rows with data
in them. Then, move to the next range of data and do the same thing
over again... I cannot find how to write that in the "Range" part. I
can make it work for doing it once because I used "cells" and make it
do 9 iterations, but i would rather it look at the whole row for data,
and then skip to the next area in my program, which is 3 lines down
from this first range of data... I'm not too good at explaining...
Could someone please help me??
Thank you.

Sub row_manipulation()

Dim I As Integer
Dim numRows As Integer
numRows = 0

For I = 2 To 100
numRows = numRows +
Application.WorksheetFunction.CountA(Range(******* )) 'checks to see if
a ninth row (new data)is entered

If numRows = 9 Then
Rows("I:I").Select 'select the first data row and delete
Selection.Delete Shift:=xlUp
Rows("I+8:I+8").Select 'insert new empty row for next time data is
entered
Selection.Insert Shift:=xlDown
End If
I = I + 11 'skip to next analyte
Next I


End Sub



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
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
General Setting Question djrak Excel Discussion (Misc queries) 2 April 30th 10 08:20 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Beginners Question setting up spreadsheet PappyJoe New Users to Excel 4 July 31st 06 04:33 AM
VBA setting Range Jeff Excel Discussion (Misc queries) 1 December 2nd 05 07:36 PM
Question regarding dynamic range setting dharmik Excel Worksheet Functions 2 July 22nd 05 08:44 PM


All times are GMT +1. The time now is 08:01 AM.

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"