Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2007

Tip: Looking for answers? Try searching our database.

VBA help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay - 21 Nov 2007 14:06 GMT
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
Don Guillett - 21 Nov 2007 14:15 GMT
Look in the vba help index for FINDNEXT. There is a good example.
c.value=1001

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Hi,
>
[quoted text clipped - 8 lines]
>
> Any help greatly appreciated.....thanks, Jason
CLR - 21 Nov 2007 19:41 GMT
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

> Hi,
>
[quoted text clipped - 8 lines]
>
> Any help greatly appreciated.....thanks, Jason
Jay - 22 Nov 2007 19:40 GMT
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

> Hi Jay........
> I got some similar help from "Ed from Az" and "Hemant_india" in another
[quoted text clipped - 28 lines]
>>
>> Any help greatly appreciated.....thanks, Jason
CLR - 23 Nov 2007 19:33 GMT
You're welcome Jay, glad you got it working.  Thanks for the feedback.

Vaya con Dios,
Chuck, CABGx3

> Thanks Chuck...that's great.  I've managed to do it thanks to your code.
>
[quoted text clipped - 38 lines]
> >>
> >> Any help greatly appreciated.....thanks, Jason
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.