UDF- Debugging

Nov 2, 2007

I'm using this as a formula =ReturnClient(A1) for example. I put the msgbox in there just to get some feedback on what was going on in there, and it does correcty show the first two digits of the cell it's referencing, but the select case is not ever hit.

Function ReturnClient(refNumCell As Range) As String

Dim cell As Range
Dim clientInit As String
Dim first2Dig As String

For Each cell In refNumCell.Cells

first2Dig = Mid(cell.Value, 1, 2)
MsgBox (first2Dig)

View 9 Replies


ADVERTISEMENT

Debugging Qtn -

Jul 9, 2008

= OFFSET(AutoMatrix!$B$1,MATCH(C3,TEST),MATCH(H1,AutoMatrix!C1:Z1,0))," ")

Can anyone seem to find any fault on this statement?

When i try to SHIFT,CTRL & ENTER - it's complaining about semi cols. on the extreme right

TEST - is a Name definition
AUTOMATRIX - is Worksheet name

View 9 Replies View Related

Cannot Save While Debugging Error

Aug 16, 2014

I got an error message that I cannot save while debugging. But I have repeatedly hit the stop icon to stop debugging!

I have minimized all the windows (except the spreadsheet as it does not allow me select it and just beeps) to make sure there are no hidden message boxes.

I do not want to force exit and lose my work but I cannot get out of debug mode for some reason!

View 6 Replies View Related

Debugging A Nested Function

Oct 2, 2009

I am receiving an error using the following string as I am not using the OR request properly.

=IF((+$B7&$C7&$D7&$E7)="","",IF(+D7="",+I6,+D7) OR IF(+D7="(blank)","",+D7))

View 2 Replies View Related

Debugging RefEdit Compile Error

Jul 9, 2009

I sent the attached to a user who said it wouldn't run when the 'Draw Venn' button is click - some sort of RefEdit compile error. I can't replicate the error and can't find what's causing the error.

I had started using RefEdit control but couldn't get it to work the way I wanted, so just went with input boxes. I run this on XL07 SP2, other user has XL03 - not sure if that's relevant to the error they're getting.

View 4 Replies View Related

Sort Code Only Executes When Debugging

Nov 15, 2006

Within the code I am asking excel to sort two difference worksheets with virtually the same code, except that one of the worksheets does not get sorted. If I step through the code, it works and the worksheet is sorted, but if I just run the macro the worksheet does not get sorted, as if the line of code in question is being skipped. Pointedly, my question is - Why does the code work while debugging (stepping through) but not when I generally run it?

Also, as far as the code is concerned, I am sure that the all variables contain the information I need them to and am also sure that any ranges created from those variables are also the ranges they should be. Here are the two lines of code that are supposed to sort. The UBOC cash sheet gets sorted, but the LNB cash sheet does not.

'Sort the UBOC cash sheet.
wsUBOC.Range("A5:G" & lUBOCRow).Sort Key1:=Range("A6"), Order1:=xlAscending, Key2:=Range("D6"), _
Order2:=xlAscending, Key3:=Range("G6"), Order3:=xlAscending, Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom

'Sort the LNB cash sheet
wsLNB.Range("A1:G" & lLNBRow).Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("C2"), _ .............

View 2 Replies View Related

Debugging The Type 13 Mismatch Error Quickly

Apr 29, 2009

What is the quickest/best way to find out exactly what is causing a Type 13 Mismatch error?

Debugging with F8 is taking forever as I have to go through loops that go through 6000+ rows each...

View 10 Replies View Related

Suspend User Defined Function While Debugging

Nov 12, 2006

I am presently trying to debug a large and repetitive piece of code and find that I keep ending up in a function within the same module. I assume this is because the function is being triggered as I manipulate data. If this is the case, does anyone know how to suspend the function while I debug? I guess I could comment it out as I do not need the data it is returning but during normal running, this is not possible and I expect if it is fired off then it will slow things down considerably if my code keeps getting interrupted by interreupts from the function.

View 2 Replies View Related

Debugging Error: Object Variable Blocked Variable Not Set

Nov 9, 2009

I am getting an error at this line:

Set rng5 = Range(.Cells(celle2.Row, celle4.Column), .Cells(celle2.Row, celle4.Column))

Sub UpdateNumbers()
Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range
Dim rng4 As Range
Dim celle1 As Range
Dim celle2 As Range
Dim celle3 As Range
Dim celle4 As Range
Dim celle5 As Range
Dim flag1 As Long
Dim flag2 As Long................

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved