Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Showing Spreadsheet values on a userform

Hi,

I am trying to create a user form that shows certain values from
specific cells when a specific worksheet is selected.

i.e. the information is summary information in a worksheet relating to
a team of people and their working return (sales).

I currently use a form to input most recent data on each team. Each
worksheet then has a summary section which totals and averages some of
the data.

IS there any way that I can create a form that allows me to use a cbo
to select a team (or worksheet) and as a result shows the summary data
on the form (i.e. saves me from sifting through the workbook and
worksheets!?)

cbo - cboTeam (list that allows me to pick relevant worksheet)

summary data is in Cell H5, H6, H7, I5, I6, I7 and J8

Presumably I can set up txtboxes as spaces to show the values - I have
done this and used the following nomenclature...

TxtH6, TxtH7 etc.

Can anyone help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Showing Spreadsheet values on a userform


'this one fills the listbox (named cbo) with all
'available sheet names
Private Sub UserForm_Initialize()

'object variables
Dim wb As Workbook 'workbook
Dim sc As Sheets 'sheets collection
Dim ws As Worksheet 'single worksheet

Set wb = ThisWorkbook
Set sc = wb.Sheets

'walk through sheets collection
For Each ws In sc

'add each name to the listbox
cbo.AddItem ws.Name

Next ws

Set ws = Nothing
Set sc = Nothing
Set wb = Nothing

End Sub


'what if we click the listbox?
Private Sub cbo_Click()

'your objects again
Dim wb As Workbook
Dim ws As Worksheet

Set wb = ThisWorkbook
Set ws = wb.Sheets(cbo.Text)

ws.Activate

'and update the form values
txtH6.Value = ws.Cells(6, 8).Value
txtH7.Value = ws.Cells(7, 8).Value
txtH8.Value = ws.Cells(8, 8).Value
'...

Set ws = Nothing
Set wb = Nothing

End Sub




schreef in bericht
ups.com...
Hi,

I am trying to create a user form that shows certain values from
specific cells when a specific worksheet is selected.

i.e. the information is summary information in a worksheet relating to
a team of people and their working return (sales).

I currently use a form to input most recent data on each team. Each
worksheet then has a summary section which totals and averages some of
the data.

IS there any way that I can create a form that allows me to use a cbo
to select a team (or worksheet) and as a result shows the summary data
on the form (i.e. saves me from sifting through the workbook and
worksheets!?)

cbo - cboTeam (list that allows me to pick relevant worksheet)

summary data is in Cell H5, H6, H7, I5, I6, I7 and J8

Presumably I can set up txtboxes as spaces to show the values - I have
done this and used the following nomenclature...

TxtH6, TxtH7 etc.

Can anyone help



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
How to fix my spreadsheet from showing formula to showing answer SimplyQuick Excel Discussion (Misc queries) 4 October 7th 08 10:00 PM
How to fix my spreadsheet from showing formula to showing answer SimplyQuick Excel Discussion (Misc queries) 0 October 7th 08 06:38 PM
Showing Userform IanC Excel Programming 16 March 10th 06 10:42 AM
Showing a userform Kent McPherson Excel Programming 1 December 4th 05 07:01 PM
Spreadsheet is only showing formulas not the actual values John Excel Worksheet Functions 2 November 24th 04 07:13 PM


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