LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default error 91 and inputbox string

The following macro needs tweaking and I am not able in any way...could
someone please have a look at it and help me!
1) When I run the macro the following error appears:
runtime error 91... Object variable or With block variable not set.
If I substitute rngNd with "C1:C20" no error message comes up.
obviously I would like to use rngNd.

2) I have tried entering "*" & strPO (which works for finding text earlier
on in the macro) but when applied as shown below it does not work.

Dim strCtr As String
Dim Cell As Range
Dim LastR As Long
Dim rngNd As Range

LastR = Cells(Rows.Count, "C").End(xlDown).Row
rngNd = Range("C1:C" & LastR)

strCtr = Application.InputBox(prompt:= _
"Inserisci Nome Contratto")

For Each Cell In wksTo.Range(rngNd)
If Cell.Value = "*" & strPO And Cell.Offset(0, -2).Value = 0 Then
Cell.Offset(0, -2).Value = strCtr
End If
Next Cell
End Sub

Thanks in advance.
 
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
hi, how to compare two string values, if the string values r from inputbox in VB srini g Excel Programming 1 April 25th 08 03:59 PM
How do I restrict an inputbox to 5<= string characters? Gabe Tiger Excel Programming 1 May 13th 06 07:08 AM
InputBox function - prompt string limit Marcotte A[_2_] Excel Programming 4 June 9th 04 09:47 AM
Fix InputBox - Returning Empty String spurtniq[_3_] Excel Programming 7 December 31st 03 06:23 PM
String length of Inputbox user input. Hersh Excel Programming 2 July 14th 03 08:47 PM


All times are GMT +1. The time now is 12:14 PM.

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

About Us

"It's about Microsoft Excel"