Canreef Aquatics Bulletin Board  

Go Back   Canreef Aquatics Bulletin Board > Other > Lounge

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2012, 08:50 PM
Parker's Avatar
Parker Parker is offline
Member
 
Join Date: Aug 2005
Location: Edmonton
Posts: 1,012
Parker is on a distinguished road
Default 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
__________________
Robb
Reply With Quote
  #2  
Old 02-13-2012, 09:39 PM
gregzz4's Avatar
gregzz4 gregzz4 is offline
On Hiatus
 
Join Date: Oct 2011
Location: Burnaby, B.C.
Posts: 4,890
gregzz4 will become famous soon enough
Default

Have you tried Ctrl+D ?
Reply With Quote
  #3  
Old 02-13-2012, 10:29 PM
globaldesigns's Avatar
globaldesigns globaldesigns is offline
Member
 
Join Date: Mar 2008
Location: Calgary, AB
Posts: 1,863
globaldesigns is on a distinguished road
Default

Here is a link for you, it may help:

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



Setup: 180G DT, 105G Refuge (approx. 300lbs LR, 150lbs Aragonite)
Hardware: Super Reef Octopus SSS-3000, Tunze ATO, Mag 18 return, 2x MP40W, 2X Koralia 4's Wavemaker
Lighting: 5ft Hamilton Belize Sun (2x250W MH, 2X80W T5HO)
Type of Aquarium: mixed reef (SPS & LPS) with fish
Dosing: Mg, Ca, Alk
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 01:47 PM.


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