Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Golbal Variable Failed

Greetings,

I have a set of named ranges named rInput1 thru rInput31 (days of the
month). I need to go to the top left cell inside these ranges and
count down to the row of interest (shown as I_1.value). I was using
this code to copy the contents of 105 TextBoxes to this row within the
chosen named range.

----------------------------------------------------------------------------------------------
For i = 2 To 105
Range("rInput" & iTD).Cells(I_1.Value, 1).Offset(0, i).Value _
= Me.Controls("I_" & i).Value
Next i
----------------------------------------------------------------------------------------------

iTD is the day and Range("rInput" & iTD) is supposed to be the named
range for that day. Debug shows the value of iTD to be correct but
when I combine it with the rest of the name for that named range, I
keep getting this error message:

----------------------------------------------------------------------------------------------
Run-time error '1004':
Method 'Range' of object '_Global' failed.
----------------------------------------------------------------------------------------------
iTD is assigned in the UserForm_Initialize procedure.

This is the code debug high lighted:

Range("rInput" & iTD).Cells(I_1.Value, 1).Offset(0, i).Value _
= Me.Controls("I_" & i).Value

Anyone see what is wrong with this code???

Any help is really appreciated.

-Minitman
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
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
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
Excel VBA - Storing text in a variable, and "'Cells' of object _Global failed" engineer[_2_] Excel Programming 3 April 23rd 04 11:35 PM


All times are GMT +1. The time now is 04:46 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"