Mike Guest98
New Member
- Joined
- Jun 4, 2018
- Messages
- 42
Hi
I have the following VBA program that works but I would like to make two changes and just not having any luck. The first change is to have the existing "1-1" accept any number combination (say 1-99 or 99-1) right now it only accepts 1-1 as a positive result.
My second request is to the have the positive result be copied to cell G15. Thank-you in advance for your help
Sub do_it()
n = [C17]
For Each cell In Range("C30:C300,E30:E300,G30:G300,H30:H300,L30:L300")
If cell.Value = n And Range(cell.Address).Offset(0, 1) = "1-1" Then
MsgBox "Found a postivive result in " & cell.Address
End If
Next
End Sub <style type="text/css">pre { direction: ltr; color: rgb(0, 0, 10); text-align: left; }pre.western { font-family: "Liberation Mono", serif; }pre.cjk { font-family: "WenQuanYi Micro Hei Mono"; }pre.ctl { font-family: "Liberation Mono"; }p { margin-bottom: 0.1in; direction: ltr; color: rgb(0, 0, 10); line-height: 120%; text-align: left; }p.western { font-family: "Liberation Serif", serif; font-size: 12pt; }p.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }p.ctl { font-family: "Lohit Devanagari"; font-size: 12pt; }</style>
I have the following VBA program that works but I would like to make two changes and just not having any luck. The first change is to have the existing "1-1" accept any number combination (say 1-99 or 99-1) right now it only accepts 1-1 as a positive result.
My second request is to the have the positive result be copied to cell G15. Thank-you in advance for your help
Sub do_it()
n = [C17]
For Each cell In Range("C30:C300,E30:E300,G30:G300,H30:H300,L30:L300")
If cell.Value = n And Range(cell.Address).Offset(0, 1) = "1-1" Then
MsgBox "Found a postivive result in " & cell.Address
End If
Next
End Sub <style type="text/css">pre { direction: ltr; color: rgb(0, 0, 10); text-align: left; }pre.western { font-family: "Liberation Mono", serif; }pre.cjk { font-family: "WenQuanYi Micro Hei Mono"; }pre.ctl { font-family: "Liberation Mono"; }p { margin-bottom: 0.1in; direction: ltr; color: rgb(0, 0, 10); line-height: 120%; text-align: left; }p.western { font-family: "Liberation Serif", serif; font-size: 12pt; }p.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }p.ctl { font-family: "Lohit Devanagari"; font-size: 12pt; }</style>