Refresh listbox on userform1

  • Thread starter Thread starter Jason Morin
  • Start date Start date
J

Jason Morin

Hello. The user keys in data to Userform1 and this data
feeds a spreadsheet, row by row (over 5 columns). On this
Userform1 there is a listbox that is populated with the
last 5 entries from the spreadsheet. This is done using a
defined name and a dynamic range formula:

=OFFSET(Sheet2!$A$2,COUNTA(Sheet2!$A:$A)-2,,-5,5)

Issue: I need the listbox to refresh with lastest 5
entries after the user has keyed in a new entry and hit a
command button to put in the data. In Access I have used
Refresh Query on my forms.

Thanks.
Jason
 
Jason,

Sorry, best I can do is to add this at the end of the code to add the new
entry

Me.ListBox1.RowSource =
"OFFSET(Sheet2!$A$2,COUNTA(Sheet2!$A:$A)-2,,-5,5)"

I did try calling another Listbox event, but they don't seem to force a
refresh.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top