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: 11
Default looping thru the worksheet

I was using the ActiveCell.Offset(0, 1).Activate to loop thru my columns to
get the value of the cell

I understand that activating the cell is not needed and it slows thing down

I'm just kind of lost :-) on how I should do this without activating the
cell

What i am attemping to do is start at a certain row then read all the cols.
and then go to next row
comapare to see if they are the same or not... delete if they are and write
a little text file to list what got
blown out ...then go to the row below my first check and do it all over
again

I got my col count and can go across. then I offset back then down a row

this is a one shot that I have been using... should I just compare the whole
row and loop from there...thx

Open wrfile For Append As #1

For q = 1 To colct
ActiveCell.Offset(0, 1).Activate
tval(q) = ActiveCell.Value
If tval(q) = cval(q) Then ' see if values the same
ck(q) = 1 'same value
Else
ck(q) = 0 ' not the same
End If
Next q

ActiveCell.Offset(0, -(colct)).Activate 'return to start col

For q = 1 To colct ' add up check values
ckval = ckval + ck(q)
Next q

If ckval = colct Then ' delete if all ones pass if not

Print #1, ck_name & " replaced " & ActiveCell.Value

Worksheets("Sheet1").Rows(ActiveCell.Row).Delete
Else
ActiveCell.Offset(1, 0).Activate ' move down a row
End If
ckval = 0
TextBox1.Text = ActiveCell.Value
Close


 
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
Looping Through Worksheet lark[_2_] Excel Programming 0 May 12th 05 04:37 PM
Only works on One Worksheet, When Looping thru All WS Dean[_5_] Excel Programming 2 January 28th 05 05:41 PM
Looping through charts in a worksheet Grant Excel Programming 1 August 6th 04 09:22 AM
Looping through ComboBoxes in a worksheet TonyM Excel Programming 2 May 18th 04 01:48 PM
Looping checkboxes embedded in worksheet Theresa[_5_] Excel Programming 1 February 27th 04 04:41 AM


All times are GMT +1. The time now is 07:50 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"