Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default User Forms - getting them to talk to Excel

A lot to answer, so a brief starting point for you:

1. It sounds like you might benefit from using a MultiPage control on
a single form - see VBA help for more info on how they work. If you
really do need separate forms, then perhaps use the Deactivate event of
one Form to call .Show method of the next.

2. Use something like:

lastrow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
ComboBox1.RowSource = "A1:A" & lastrow

to set the ComboBox1 range to be the last row with data in column A on
Sheet1. Change according to where your actual data is!

As for avoiding duplicates, it would be handy if you had a set format
for clients' names to check - just in case "James Thompson LTD." gets
entered as "J Thompson LTD." in the future.

Have a look at Application.Find to help with searching for text etc.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - getting them to talk to Excel


Hey Jakey,

Thanks for the ideas! I will keep both you and Tom posted as thing
progress.

I considered MultiPage Controls, but there are several steps, and
want my users to go through them in a precise order. It is m
understanding that a multipage has tabs, and the users would be able t
shift from one to the other, and in that way they might miss a step. Or
am I wronge. Admitidly I don't know a whole lot about user forms, s
please if I am off base let me know where my thinking strayed.

See ya' around,
Amber:)


JakeyC Wrote:
A lot to answer, so a brief starting point for you:

1. It sounds like you might benefit from using a MultiPage control on
a single form - see VBA help for more info on how they work. If you
really do need separate forms, then perhaps use the Deactivate even
of
one Form to call .Show method of the next.

2. Use something like:

lastrow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
ComboBox1.RowSource = "A1:A" & lastrow

to set the ComboBox1 range to be the last row with data in column A on
Sheet1. Change according to where your actual data is!

As for avoiding duplicates, it would be handy if you had a set format
for clients' names to check - just in case "James Thompson LTD." gets
entered as "J Thompson LTD." in the future.

Have a look at Application.Find to help with searching for text etc


--
Amber_D_Law
-----------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...fo&userid=3001
View this thread: http://www.excelforum.com/showthread.php?threadid=50587

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default User Forms - getting them to talk to Excel

Design your MultiPage with tabs first so that you can easily switch
between pages. Then, when you are ready to give it to your users change
the Style propery of the MultiPage to '2 - fmTabStyleNone' which
removes the tabs. Make sure of course that you provide a button for
them to select the next page!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - getting them to talk to Excel


Thanks Jakey!

I am still working through the literature that Tom referred me to, an
I have just come across some details on MultiPages. I am glad yo
mentioned them; because other wise I don't know that I would hav
considered them. I like the idea about changing the tab style. Th
whole point of this is to keep my users from being able to change wha
they should not be allowed to change.

Maybe you can give me a little help with something along these lines.
Do you know how to add a status bar of some sort so they can see ho
close to completion they are?
I haven't found anything relating to this so far. I was thinking o
something like sequentially called images, but I am sure there is a
easier way.
Any ideas?


Regards,
Amber:)


JakeyC Wrote:
Design your MultiPage with tabs first so that you can easily switch
between pages. Then, when you are ready to give it to your user
change
the Style propery of the MultiPage to '2 - fmTabStyleNone' which
removes the tabs. Make sure of course that you provide a button for
them to select the next page


--
Amber_D_Law
-----------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...fo&userid=3001
View this thread: http://www.excelforum.com/showthread.php?threadid=50587

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default User Forms - getting them to talk to Excel

Application.Statusbar will change the message in the bottom left of the
window. You could have a very crude one that starts at "0%
Completed..." then a quarter of the way through your code becomes "25%
Completed..." etc.

John Walkenbach has a nice graphical solution at
http://www.j-walk.com/ss/excel/tips/tip34.htm which might be of use.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - getting them to talk to Excel


Thanks for the tip. I will look into it when I really get to that stage

Hopefully you can help with this. Please see the code snipet below:


Code
-------------------
Dim SourceData As Range
Dim found As Object

Set SourceData = Range("Companies")
Set found = Nothing
'Try to find the value on the worksheet
Set found = SourceData.Find(txtCompanyName.Value)

'If item is not found in the list...
If found Is Nothing Then
'redefine Companies
SourceData.Resize(SourceData.Rows.Count = 1, 1).Name = "Companies"
'add the new item to the end of the list on the worksheet
SourceData.Offset(SourceData.Rows.Count, 0).Resize(1, 1).Value = txtCompanyName.Value
'Reset the list displayed in the ComboBox
txtCompanyName.RowSource = Range("Companies").Address(external:=True)
End I
-------------------


I am running into errors at the SourceData.Resize... point of thi
code. It says "Application-defined or Object-defined error".
Help!!! I got this code straight off of one of the sites Tom refered m
to, one of the microsoft sites no less. The only thing I changed was th
text for the named range. The one from online used ListRange, and I use
Companies. That shouldn't make a difference should it.

Thanks a heap in advance!


JakeyC Wrote:
Application.Statusbar will change the message in the bottom left of the
window. You could have a very crude one that starts at "0%
Completed..." then a quarter of the way through your code becomes "25%
Completed..." etc.

John Walkenbach has a nice graphical solution at
http://www.j-walk.com/ss/excel/tips/tip34.htm which might be of use


--
Amber_D_Law
-----------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...fo&userid=3001
View this thread: http://www.excelforum.com/showthread.php?threadid=50587

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - getting them to talk to Excel


Bump to top of list..

--
Amber_D_Law
-----------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...fo&userid=3001
View this thread: http://www.excelforum.com/showthread.php?threadid=50587

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Forms - getting them to talk to Excel


Problem solved. There is an typo in the line
"SourceData.Resize(SourceData.Rows.Count = 1, 1).Name = "Companies""
the = in between Count and 1 should have been a +. However, now I have
a new error issue, and it does not seem typo related.


Code:
--------------------
'Reset the list displayed in the ComboBox
txtCompanyName.RowSource = Range("Companies").Address(external:=True)
--------------------


The error message is:

Could not set the RowSource property. Member not found.

Any ideas?

Thanks,
Amber

Amber_D_Laws Wrote:
Thanks for the tip. I will look into it when I really get to that stage.

Hopefully you can help with this. Please see the code snipet below:


Code:
--------------------
Dim SourceData As Range

Dim found As Object

Set SourceData = Range("Companies")
Set found = Nothing
'Try to find the value on the worksheet
Set found = SourceData.Find(txtCompanyName.Value)

'If item is not found in the list...
If found Is Nothing Then
'redefine Companies
SourceData.Resize(SourceData.Rows.Count = 1, 1).Name = "Companies"
'add the new item to the end of the list on the worksheet
SourceData.Offset(SourceData.Rows.Count, 0).Resize(1, 1).Value = txtCompanyName.Value
'Reset the list displayed in the ComboBox
txtCompanyName.RowSource = Range("Companies").Address(external:=True)
End If

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


I am running into errors at the SourceData.Resize... point of this
code. It says "Application-defined or Object-defined error".
Help!!! I got this code straight off of one of the sites Tom refered
me to, one of the microsoft sites no less. The only thing I changed
was the text for the named range. The one from online used ListRange,
and I used Companies. That shouldn't make a difference should it.

Thanks a heap in advance!



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=505875

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
User Forms and Excel Functions sottsee Excel Programming 1 July 14th 05 11:29 PM
User forms in Excel Eric Excel Programming 3 February 11th 05 06:10 PM
New user in need of assistance excel pop-ups, forms, +more!! Ken Macksey New Users to Excel 4 January 15th 05 03:18 PM
Excel 2003 hangs with dates in user forms hlask Excel Programming 0 June 3rd 04 09:21 AM


All times are GMT +1. The time now is 12:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"