Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default object variable or with block variable not set


hi

my problem is with bal.value, a message box appears tilling me objec
variable or with block variable not set............the rest of hte cod
works fine

could u pls tell me why is this..........Thank u

Code:

PHP code
-------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim T As Range
Dim bal As Range
Set T = Range("I5:BN1000")
bal.Value = Range("F" & Target.Row)

If Not Application.Intersect(Target, T) Is Nothing Then
If ActiveSheet.Range("F" & Target.Row).Value < "" And _
ActiveSheet.Range("F" & Target.Row).Value < 0 Then

Beep
MsgBox "imbalanced" & bal
End If
End If
End Su
-------------------



all helps r appreciated :)
yours


--
helmekk

-----------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...nfo&userid=693
View this thread: http://www.excelforum.com/showthread.php?threadid=26987

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default object variable or with block variable not set

It looks like you want bal to be a simple variable:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim T As Range
Dim bal As Variant 'what's in column F of that row?
Set T = Range("I5:BN1000")
bal = Range("F" & Target.Row).Value

If Not Application.Intersect(Target, T) Is Nothing Then
If bal < "" And _
bal < 0 Then
Beep
MsgBox "imbalanced" & bal
End If
End If
End Sub

bal was already equal to range("F" & target.row).value



helmekki wrote:

hi

my problem is with bal.value, a message box appears tilling me object
variable or with block variable not set............the rest of hte code
works fine

could u pls tell me why is this..........Thank u

Code:

Formula:
--------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim T As Range
Dim bal As Range
Set T = Range("I5:BN1000")
bal.Value = Range("F" & Target.Row)

If Not Application.Intersect(Target, T) Is Nothing Then
If ActiveSheet.Range("F" & Target.Row).Value < "" And _
ActiveSheet.Range("F" & Target.Row).Value < 0 Then

Beep
MsgBox "imbalanced" & bal
End If
End If
End Sub
--------------------


all helps r appreciated :)
yours
h

--
helmekki

------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=269871


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM
QueryTables Object Variable or With Block Variable Not Set Gjones Excel Programming 0 April 26th 04 10:09 PM
Pivot Table - Object variable or with block variable not set? George Nicholson[_2_] Excel Programming 1 April 16th 04 09:12 PM
Error 91 - Object variable with block variable not set Jim[_35_] Excel Programming 2 November 27th 03 03:34 AM


All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"