Canreef Aquatics Bulletin Board

Canreef Aquatics Bulletin Board (http://www.canreef.com/vbulletin/index.php)
-   Lounge (http://www.canreef.com/vbulletin/forumdisplay.php?f=14)
-   -   VB In Excel (http://www.canreef.com/vbulletin/showthread.php?t=83068)

Parker 02-13-2012 08:50 PM

VB In Excel
 
Anyone good with Visual Basic in Excel?

I have a piece of code I'm having trouble with:

Quote:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Range("A1")
If Not Intersect(Target, rng) Is Nothing Then
If rng = "Product A" Then
MsgBox "Are we Making Product B That Day?"
End If
End If
Set rng = Nothing
End Sub
I can get this to function for 1 cell only (A1) I need it to function for the entire column (A1:A5000) and I can't seem to get it to function and I'm not sure why.

If I use the range (A1:A5000) I get a error in this line:

Quote:

If rng = "Product A" Then

gregzz4 02-13-2012 09:39 PM

Have you tried Ctrl+D ?

globaldesigns 02-13-2012 10:29 PM

Here is a link for you, it may help:

http://support.microsoft.com/kb/291308


All times are GMT. The time now is 04:04 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.