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: 355
Default Help With Code - Array and Range

Dim c As Variant
Dim i As Variant
Dim numError As Integer
numError = 0
Dim Grng As Range
Dim iVar As Integer
Dim Arng As Variant
iVar = 0

Arng = Array("I9", "I15", "I19", "I22", "I25", "I39")
With ActiveSheet
Set Grng = .Range("G9, G15, G19, G22, G25, G39")
End With
For Each i In Grng.Cells
If i.Text = "No" Or i.Text = "N/A" Then
'Then check to see if indiv cell in I = empty
If Len(Trim(ActiveSheet.Range(Arng(iVar)))) <= 1 Then
numError = numError + 1
End If
iVar = iVar + 1
End If
Next i
MsgBox("Number of blanks: " & numError _
& vbCrLf & vbCrLf & "Blank cells(s): " & vbCrLf & vbCrLf & CellAddresses



Cell Addresses is the part of the MsgBox I need. If numError is 0, I have
to loop through cells in G and cells in I and list them in the MsgBox, five
cells per line with commas between each cell.

I did something similar to this a few days ago and thought I could just plug
in that code, however, this time, there are two columns to consider -- if the
G cell is blank it needs to be displayed in the list, or if the G cell has
"No" or "N/A" then Column I has to be checked for a blank; if it is blank, it
has to be listed too.

Any help will be greatly appreciated!!

--
Sandy
 
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
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Excel Programming 0 July 27th 05 03:59 PM
Can I use array to simplify this code. broogle Excel Programming 3 March 18th 05 12:57 PM
Code for Array formula Annette[_5_] Excel Programming 1 February 22nd 05 02:09 PM
VB Code Naming a Range (range changes each time) krazylain Excel Programming 4 May 15th 04 12:41 PM
Simplifying code using array John Pierce Excel Programming 3 December 15th 03 03:17 AM


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