Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sam
 
Posts: n/a
Default accessing rows with macros

Hi,
I'm quite new to excel. I'd like to loop through all the rows in my
sheet and compare the text in the cells of the first column with some
string variable priorly set.
How can I do that ?

Also I would like to disable my cells for editing, so that only my
function run when I click on a button can modify those cells. I've done
it through protecting the sheet from editing, but then even my macro
can't edit the cell without having to enter the password;)

Thx

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default


For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
If Cells(i,"A") = "somevalue" Then
'do something
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sam" wrote in message
oups.com...
Hi,
I'm quite new to excel. I'd like to loop through all the rows in my
sheet and compare the text in the cells of the first column with some
string variable priorly set.
How can I do that ?

Also I would like to disable my cells for editing, so that only my
function run when I click on a button can modify those cells. I've done
it through protecting the sheet from editing, but then even my macro
can't edit the cell without having to enter the password;)

Thx



  #3   Report Post  
Sam
 
Posts: n/a
Default

thanks a lot , that works

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

my pleasure

Bob


"Sam" wrote in message
ups.com...
thanks a lot , that works



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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 07:11 PM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM
Row selections by row # OR by even/odd rows in another spreadsheet Tom Excel Discussion (Misc queries) 0 February 9th 05 04:03 PM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM


All times are GMT +1. The time now is 09:46 AM.

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

About Us

"It's about Microsoft Excel"