#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default userform

ok i have a userform.in the properties-controlsource
filed i hav put where i want the data to go on the
spreadsheet. e.g A2

but i dont always want it to go there. i want it to stay
in that column but go to the next blank cell.how?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default userform

Sounds like you will need to determine the last row. Try this

Sub WriteLastRow(
Dim LastRow As Intege
With Worksheets("Sheet1"
LastRow = .Cells.Find("*", [A1], , , xlByRows, xlPrevious).Ro
.Cells(LastRow + 1, 1) = Me.Textbox1.Tex
End Wit
End Su

Kevin
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default userform

You would need the click event and write the value to that cell. Remove the
controlsource property

Private Sub Combobox1_Click()
Dim rng as Range
Set rng = Cells(rows.count,"A").End(xlup)(2)
rng.Value = combobox1.Value
End Sub

--
Regards,
Tom Ogilvy

"Aashi" wrote in message
...
ok i have a userform.in the properties-controlsource
filed i hav put where i want the data to go on the
spreadsheet. e.g A2

but i dont always want it to go there. i want it to stay
in that column but go to the next blank cell.how?



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
UserForm bgkgmg Excel Worksheet Functions 1 February 26th 09 04:25 PM
Userform Add hazel Excel Discussion (Misc queries) 8 November 3rd 06 07:01 PM
Userform Jeff Excel Discussion (Misc queries) 1 April 25th 06 07:30 PM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM
userform billQ Excel Programming 3 November 19th 03 03:41 AM


All times are GMT +1. The time now is 07:09 AM.

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"