|
-
Jul 6th, 2000, 02:08 PM
#1
Thread Starter
Junior Member
hey
i have a program that looks like this:
Sub B()
Dim rng As Range, rng2 As Range, cell As Range
Set rng = Range("F4.F66")
For Each cell In rng
If cell >= 1 Then
******
End If
Next cell
Set rng = Nothing
Set cell = Nothing
where the stars are i need code that will take the data in column b,c,d,e,f,g of the cell that is selected and copy it into b101. any help?
Steve
-
Jul 6th, 2000, 02:43 PM
#2
Hyperactive Member
Code:
Sub B()
Dim i As Integer, res As Integer, str As String
Dim rng As Range, cell As Range
Set rng = Range("F4:F66")
For Each cell In rng
If cell > 0 Then
res = 0
' str = ""
For i = 0 to 5
res = res + cell.Offset(0, i - 4)
' str = str & cell.Offset(0, i - 4) & " "
Next i
ActiveSheet.Range("B101") = res ' or str...
Exit For
End If
Next cell
Set rng = Nothing
Set cell = Nothing
End Sub
[Edited by Mongo on 07-06-2000 at 03:46 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|