View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Dyn Named Range update from userform

try

'''Update dynamic named range in column A named dynProjectTitle
Sheets("OutputData").Calculate
doevents
Sheets("OutputData").cboDynEditEntry._
ListFillRange = "dynProjectTitle"


if that doesn't help, show the formula you are using to define you dynamic
name range.

--
Regards
Tom Ogilvy


"KD" wrote in message
ups.com...
Hi All:

Some help here would be great. I am falling a little short on the
nuances of procedures that include dynamic named range.

I have a fairly large multipage userform that validates entries,
calculates some risk metrics and puts all data (input and output) into
an output worksheet. The output worksheet has a combobox
(cbodynEditEntry) that allows the user to edit a particular row.
cbodynEditEntry has a listfillrange that is a dynamic named range
representing the first column (rangename=dynProjectTitle).

The problem is not in running a new project through the userform, but
in editing an existing. My logic was to, upon selection of existing
project (either in userform or output sheet), find row with same
project title, delete that row, and repopulate with the modified data
stored in the userform. When I do this, the first column does not
delete and update. It only deletes. This then messes up
cbodynEditEntry. Some sample code follows. Thanks much and hope to
return the favor.

--------------------------------------------------------------------------

----------------------------------------
Private Sub Run_Click
Dim title as Range
Application.ScreenUpdating = False
On Error Resume Next

'''Find matching project title in row and delete row
Sheets("OutputData").Select
Set title = Range("dynProjectTitle")._
Find(cboProjectTitle.Value)
title.Select
ActiveCell.EntireRow.Delete shift:=xlShiftUp

'''Populate from userform ***The A procedure does not work. B works
fine.***
Worksheets("OutputData").Range("A65536")._
End(xlUp)(2).Value = cboProjectTitle.Text
Worksheets("OutputData").Range("B65536")._
End(xlUp)(2).Value = cboStateInput.Text

'''Update dynamic named range in column A named dynProjectTitle
Sheets("OutputData").cboDynEditEntry._
ListFillRange = "dynProjectTitle"

Unload Me
Application.ScreenUpdating = True

End Sub


Thanks again.
James KD