VBA help

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hi,

I'm an excel VBA total novice. I dabble in access vba, but am unsure where
to start in excel.

What I need is some code I can tie to a macro (& keyboard shortcut) which
will find all values under 1000 in the selected range and change them to
1001.

Can anyone point me in the right direction?

Any help greatly appreciated.....thanks, Jason
 
Hi Jay........
I got some similar help from "Ed from Az" and "Hemant_india" in another
group. Perhaps this is what you're looking for.....

Sub ChgValuesInSelectedRange()
Dim Range1 As Range
Dim EaCell As Range
Set Range1 = Selection
For Each EaCell In Range1
If IsNumeric(EaCell.Value) Then
If EaCell.Value < Range("a14").Value And EaCell.Value <> "" Then
EaCell.Value = Range("a15").Value
End If
End If
Next EaCell
End Sub

Vaya con Dios,
Chuck, CABGx3
 
Thanks Chuck...that's great. I've managed to do it thanks to your code.

I've only written VBA for Access (because you *have* to if you want any
proper functionality.

I guess I just have to start thinking in terms of ranges etc., rather
than the access object model.

Thanks again........Regards, Jason, UK
 
You're welcome Jay, glad you got it working. Thanks for the feedback.

Vaya con Dios,
Chuck, CABGx3
 
Back
Top