Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Update a range reference change

I have a user form that pops up and the user selects various things and
then hits a save button to record all the selections made to a
worksheet. I then set a worksheet range to that row where the data was
just entered.
My problem is that this new range area does not seem to be updated and
available when it gets set. I have a print button on the user form that
hides the initial form and displays a worksheet. The work sheet uses
formulas like: =INDEX(Print_Range,1,8) to get cell values from this
print range that was supposedly just defined. I put several msgboxes
in my code to see what the range("Print_Range").Name is set to and it
comes back with the correct range but when my worksheet is shown the
"Print_Range" range has not been updated to the new row.
The bizarr thing is that when I rerun the user form and genereate a new
line of info and set the "Print_Range" to this new line it all works
fine. The Print button on my user for runs the same code again for a
second time and all is well.

Is there something that I have to refresh or recalculate on the
worksheet that will make it accept this new range reference? Or is
there something with just hiding the user form and not unloading it for
this range change to take effect.

THanks
Scott

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Update a range reference change

Here is the first part of the code from my print button that sets this
new print range. I also tested and found my search user form that
searches for a line on the worksheet does not work correctly the very
first time I run it. I run it a second time and it works fine.
???????????????

Private Sub CommandButton3_Click()
Dim Rng As Range
Dim Record

Record = "RFQ" & UserForm1.TextBox7.Value &
UserForm1.TextBox8.Value
Set Rng = Sheets("Master
log").Range("Unique_Identifier").Find(what:=Record , LookAt:=xlWhole,
LookIn:=xlFormulas, SearchDirection:=xlNext, MatchCase:=False)

'Load the new RFQ info onto Email page
ActiveWorkbook.Names.Add Name:="Print_Range",
RefersToR1C1:="='Master log'!R" & Rng.Row

..
..
..
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Update a range reference change

I figured out what was happening. I showed the userform from the
on_open sub of the workbook and on the line after I showed the userform
was the line where I blanked out my range reference. I moved this line
above showing the user form and now it resets my print range, opens the
user form and lets the user form redefine the print range.

I thought I was going crazy for a bit but after some very close step by
step investigation (and a few days away from it) it all was clear to
me.


Scott

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
Possible to change/update values in range of cells by X% ? Tom McLean Excel Discussion (Misc queries) 10 March 18th 10 05:30 PM
Shortcut to change change cell reference to Absolute reference? richk Excel Worksheet Functions 12 December 5th 09 12:24 AM
Dynamic range where the reference cell can change hello Excel Discussion (Misc queries) 2 May 19th 08 10:11 PM
change change cell reference to Absolute reference art Excel Discussion (Misc queries) 5 March 13th 08 02:41 AM
Update date field upon cell range change Carole O Excel Worksheet Functions 1 May 16th 07 05:04 AM


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