Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Object variable or with block variable not set - what's going on??

As you setting the .Value (default property) of the Cells(16,2) etc, you do
not need the Set keyword.
That is only or object variables.
Cells(16, 2).Value = P1R1_udbt_start

NickHK

"Kragelund" wrote in message
...
Public P1R1_udbt_start As Integer, P1R1_udbt_length As Integer,
P1R1_amount_primo As Double

Public Sub Export_P1R1()

Dim i As Integer, j As Integer
Dim sheets As worksheets
Dim worksheets As worksheets

worksheets("Per.1 Rate.Pen. nr. 1").Activate
With Cells
Set Cells(16, 2) = P1R1_udbt_start
Set Cells(30, 6) = P1R1_udbt_length
Set Cells(31, 8) = P1R1_amount_primo
End With

sheets("IndtPer1").Activate

For i = 0 To 55
On Error Resume Next

With Cells
Cells(10 + i, 1).Select
If Cells(10 + i, 1) = P1R1_udbt_start Then
Cells(10 + i, 12).Select
End If

For j = 0 To P1R1_udbt_length - 1
Cells(10 + i + j, 12) = P1R1_amount_primo
Next j
Cells(10 + P1R1_udbt_length, 12).Select

End With

Next i

sheets("Per.1 Rate.Pen. nr. 1").Select

End Sub



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
Getting inconsistent Error 91-Object variable or With block variable not set mfq Excel Programming 0 December 14th 05 06:08 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM
Pivot Table - Object variable or with block variable not set? George Nicholson[_2_] Excel Programming 1 April 16th 04 09:12 PM


All times are GMT +1. The time now is 06:32 PM.

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"