|
-
Dec 22nd, 2005, 07:16 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Excel Gurus needed: Combine into one statement
I need to get these two together somehow, someway:
Don't know how since they use different cell ranges. Please, please, help I really need to move past this. Thanks!
VB Code:
' ----------first statement---------------
For Each MyCell2 In Sheet1.Columns("A").Cells
With MyCell2
If .Value = "" Then Exit For
If .Value = 574 _
Or .Value = 555 _
Or .Value = 510 Then
.Offset(0, 12).Value = .Offset(0, 8).Value * 1.1
End If
End With
Next MyCell2
'-------------second statement-------------
For Each MyCell3 In Sheet1.Columns("D").Cells
With MyCell3
If .Value = "" Then Exit For
If .Value <> "OMI" Then
.Offset(0, 9).Value = .Offset(0, 5).Value * 1.4503
Else
.Offset(0, 9).Value = .Offset(0, 5).Value
End If
End With
Next MyCell3
-
Dec 22nd, 2005, 10:38 AM
#2
Re: Excel Gurus needed: Combine into one statement
I have no clue what you need to accomplish
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Dec 22nd, 2005, 11:35 AM
#3
Thread Starter
Hyperactive Member
Re: Excel Gurus needed: Combine into one statement
If cells in Column D don't equal "OMI" times value by 1.4503, but it the cells in Column A are 574, 555, or 510 then only times them by 1.1, else just keep the value from one cell and put it in another.
-
Dec 22nd, 2005, 12:06 PM
#4
Re: Excel Gurus needed: Combine into one statement
You may need to put loop2 inside your loop1 then. Make sense?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Dec 22nd, 2005, 12:26 PM
#5
Thread Starter
Hyperactive Member
Re: Excel Gurus needed: Combine into one statement
I figured it out! Thanks!
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
|