Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textbox trouble on a user form

Hello,

I've created a user form with various text boxes and comboboxes whic
enters info into specific columns on a worksheet named "METRO". Th
code I used to enter the data searches for the last cell, (in METRO)
with data in a specific column and offsets it by one so the new info
(plugged into the form), is entered in the next "empty" row. I'v
listed a portion of the code I used below.
r = ws.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).Row

Column A of worksheet METRO is labeled as 'ticket number" which i
populated by a formula that is linked to another sheet.


On the user form I've created is a textbox I would like to have displa
the ticket number that the data entered into the form will populate.
I hope I didn't get too long winded or confusing. Any Ideas??

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Textbox trouble on a user form

Textbox1.Text = ws.Cells(r,"A").Text?

--

HTH

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

"Oreg " wrote in message
...
Hello,

I've created a user form with various text boxes and comboboxes which
enters info into specific columns on a worksheet named "METRO". The
code I used to enter the data searches for the last cell, (in METRO),
with data in a specific column and offsets it by one so the new info,
(plugged into the form), is entered in the next "empty" row. I've
listed a portion of the code I used below.
r = ws.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).Row

Column A of worksheet METRO is labeled as 'ticket number" which is
populated by a formula that is linked to another sheet.


On the user form I've created is a textbox I would like to have display
the ticket number that the data entered into the form will populate.
I hope I didn't get too long winded or confusing. Any Ideas???


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Textbox trouble on a user form

Oreg,

After r is set using this:
r = ws.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).Row

The corresponding ticket number should be
ws.Range("A"& r).Value

You can assign it to the textbox using code like
Userform1.Textbox1.Text = ws.Range("A"& r).Value

HTH,
Bernie
MS Excel MVP

"Oreg " wrote in message
...
Hello,

I've created a user form with various text boxes and comboboxes which
enters info into specific columns on a worksheet named "METRO". The
code I used to enter the data searches for the last cell, (in METRO),
with data in a specific column and offsets it by one so the new info,
(plugged into the form), is entered in the next "empty" row. I've
listed a portion of the code I used below.
r = ws.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).Row

Column A of worksheet METRO is labeled as 'ticket number" which is
populated by a formula that is linked to another sheet.


On the user form I've created is a textbox I would like to have display
the ticket number that the data entered into the form will populate.
I hope I didn't get too long winded or confusing. Any Ideas???


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textbox trouble on a user form

It took some play'n with but I finally got it. Thanks Bernie and Bob.
Never would've got it. Thanks again!!!

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textbox trouble on a user form

One last question for you. How would I get the textbox t
automatically update to the next ticket number after info is added.
Currently, with your help, it displays the same ticket number afte
data is added. Thanks guys

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Textbox trouble on a user form

Oreg,

Use one of the events of one of your objects being filled in to force a
recalc of your r value, and of the textbox text.

HTH,
Bernie
MS Excel MVP

"Oreg " wrote in message
...
One last question for you. How would I get the textbox to
automatically update to the next ticket number after info is added.
Currently, with your help, it displays the same ticket number after
data is added. Thanks guys!


---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Textbox trouble on a user form

Hi Oreg,

In the METRO worksheet


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 1 Then
With Target
Userform1.Textbox1.Text = .Text
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

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

"Oreg " wrote in message
...
One last question for you. How would I get the textbox to
automatically update to the next ticket number after info is added.
Currently, with your help, it displays the same ticket number after
data is added. Thanks guys!


---
Message posted from http://www.ExcelForum.com/



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textbox trouble on a user form

Thanks,

Once again...worked great...have you ever been stumped??

--
Message posted from http://www.ExcelForum.com

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
Trouble with saving user input in an Excel Form. University of Maine student Excel Discussion (Misc queries) 0 March 14th 06 07:31 PM
User Form in VB = TextBox Kel Excel Discussion (Misc queries) 1 August 11th 05 12:26 AM
User form trouble Patty[_2_] Excel Programming 6 November 5th 03 05:56 PM
Format of a textbox on a user form controled by a spinner Jeff[_20_] Excel Programming 1 September 9th 03 05:09 AM
User Form textbox formatting Neal[_2_] Excel Programming 0 August 20th 03 08:14 PM


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