PC Review


Reply
Thread Tools Rate Thread

Can anyone help, with a formla

 
 
Janine
Guest
Posts: n/a
 
      20th Sep 2006
Hi,

I have a code, obviously! anyway i am trying to run it but i keep
coming back with compile error sub or functions not defined.

Here is the code
Sub Start()
abort_op = False
'Sheets(1).Activate
Application.StatusBar = ""
UserForm2.Show
Application.Wait Now + TimeValue("00:00:02")
Sheets(1).Select
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

Dim LR As Long
Dim LC As Long
Dim i As Long
Dim Rw As Long
Sheets(1).Range("B2", Range("B65536").End(xlUp)).Select
Rw = Selection.Rows.Count 'Determine last used Row in column
For i = 2 To (Rw + 1)
Sheets(1).Select
Application.StatusBar = "Checking for existing Clients and Creating
New Client Sheets "
ROWNO = i
If Cells(i, 2).Value <> vbNullString Then
Cells(i, 2).Value = Replace(Cells(i, 2).Value, "/", "_")
Checksheet = Cells(i, 2).Value
Call AddSheetWithNameCheckIfExists
Else
End If
Application.StatusBar = "Checking for existing Clients and Creating
New Client Sheets " & i & " of " & Rw + 1
Next i

When i debug the formula it highlights replace and now i am stuck! If
anyone can help pleas let me know.

thank you Janine

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      20th Sep 2006
I cannot reproduce the problem, but why would you try and replace anything
in a cell just after having ascertained it is a null value there?

Also vbNullstring is really meant to call external procedures, not to use
like that, I always use

If IsEmpty( Cells(i, 2).Value) Then

or

If Cells(i, 2).Value = "" Then

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Janine" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a code, obviously! anyway i am trying to run it but i keep
> coming back with compile error sub or functions not defined.
>
> Here is the code
> Sub Start()
> abort_op = False
> 'Sheets(1).Activate
> Application.StatusBar = ""
> UserForm2.Show
> Application.Wait Now + TimeValue("00:00:02")
> Sheets(1).Select
> With Application
> .Calculation = xlCalculationManual
> .ScreenUpdating = False
> End With
>
> Dim LR As Long
> Dim LC As Long
> Dim i As Long
> Dim Rw As Long
> Sheets(1).Range("B2", Range("B65536").End(xlUp)).Select
> Rw = Selection.Rows.Count 'Determine last used Row in column
> For i = 2 To (Rw + 1)
> Sheets(1).Select
> Application.StatusBar = "Checking for existing Clients and Creating
> New Client Sheets "
> ROWNO = i
> If Cells(i, 2).Value <> vbNullString Then
> Cells(i, 2).Value = Replace(Cells(i, 2).Value, "/", "_")
> Checksheet = Cells(i, 2).Value
> Call AddSheetWithNameCheckIfExists
> Else
> End If
> Application.StatusBar = "Checking for existing Clients and Creating
> New Client Sheets " & i & " of " & Rw + 1
> Next i
>
> When i debug the formula it highlights replace and now i am stuck! If
> anyone can help pleas let me know.
>
> thank you Janine
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
formla IMRAN Microsoft Excel Misc 1 18th Nov 2008 04:40 PM
Excel formla =?Utf-8?B?Rm9yZ2V0ZnVscGdr?= Microsoft Excel Misc 5 22nd Aug 2006 06:06 PM
formla fields Tim Microsoft Word New Users 2 10th Feb 2006 07:25 AM
Array Formla =?Utf-8?B?RG9uIFJvdW50cmVl?= Microsoft Excel Worksheet Functions 8 7th Nov 2003 09:57 PM
work schedule formla's Phil Microsoft Excel Programming 2 29th Oct 2003 09:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:22 PM.