Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default multiple cells

I am trying to get the following code to work for a range of cells.
Each time I put in for example Range("A1:A10").value = "whatever" the
system says that there is an error.

This is what I have so far:

Dim n
n = 1
If Range("N6").Value < n Then
Range("D6").Value = ""
Range("e6").Value = ""
End If

This what I would like to do.. something to this effect

Dim n
n=1
if range("N6:N31").Value < n then
Range("D6:D31").Value = ""
Range("E6:E31").Value = ""

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default multiple cells


Dim n As Integer
Dim myCell As Range
n = 1
For Each myCell In Range("N6:N31")
If myCell.Value < n Then
Cells(myCell.Row,4).Value = ""
Cells(myCell.Row,5).Value = ""
End If
Next myCell

And please don't multi-post - Crossposting is OK...
HTH,
Bernie
MS Excel MVP


"ssrvant" wrote in message
oups.com...
I am trying to get the following code to work for a range of cells.
Each time I put in for example Range("A1:A10").value = "whatever" the
system says that there is an error.

This is what I have so far:

Dim n
n = 1
If Range("N6").Value < n Then
Range("D6").Value = ""
Range("e6").Value = ""
End If

This what I would like to do.. something to this effect

Dim n
n=1
if range("N6:N31").Value < n then
Range("D6:D31").Value = ""
Range("E6:E31").Value = ""



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default multiple cells

You have another reply at one of your other posts.

ssrvant wrote:

I am trying to get the following code to work for a range of cells.
Each time I put in for example Range("A1:A10").value = "whatever" the
system says that there is an error.

This is what I have so far:

Dim n
n = 1
If Range("N6").Value < n Then
Range("D6").Value = ""
Range("e6").Value = ""
End If

This what I would like to do.. something to this effect

Dim n
n=1
if range("N6:N31").Value < n then
Range("D6:D31").Value = ""
Range("E6:E31").Value = ""


--

Dave Peterson
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
Select multiple adjacent cells of multiple cells without selecting sjsjsjsjsjs New Users to Excel 11 December 24th 09 01:09 AM
Select multiple adjacent cells of multiple cells without selecting sjsjsjsjsjs Excel Worksheet Functions 7 December 23rd 09 08:54 PM
Setting multiple conditions to return a figure from multiple cells Sapper Excel Discussion (Misc queries) 4 April 26th 09 10:33 PM
macro copy/paste data from multiple cells to multiple cells Diana Excel Discussion (Misc queries) 0 July 10th 06 09:24 PM
make multiple cells in 1 worksheet equal multiple cells in another riley454 Excel Worksheet Functions 1 January 19th 06 03:00 PM


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