LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List Selection to First Empty Row

I have inherited a worksheet which has a macro that places the selectio
from a listbox into a cell on a worksheet. That becomes the range tha
is placed on the main worksheet when the user clicks ok. The proble
is that range is then placed wherever the cursor is in the mai
worksheet. I need to alter or add to the vba language to make th
selection go to the first empty row in column A so that the user canno
place the entry anywhere but in column A. Could anyone please look a
this for me? Thank you in advance for any suggestions

Private Sub CommandButton1_Click()
'if the listindex of listbox equals -1 ... nothing selected
If ListBox1.ListIndex = -1 Then
MsgBox "No item selected", vbExclamation
Exit Sub
End If
Range("SelectionLink") = ListBox1.ListIndex + 1
Selection.Cells(1) = Worksheets("Products").Range("D1")
Selection.Cells(1).Offset(0, 1) = Worksheets("Products").Range("E1")
Unload Me
End Su

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

 
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
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Remove empty cells from named list / validation list Sp00k Excel Worksheet Functions 4 April 28th 06 03:45 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM
Selection of non-empty cells Adrian[_7_] Excel Programming 6 July 22nd 04 01:06 PM


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