Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default duplicate listbox selection to range of cells?


Is is possible to amend the following macro, so that a listbox selection
is copied to a range of consecutive cells? Yes that's right! For
scheduling purposes I need exactly the same value copied to each cell.
The macro listed below only copies the selection to the active cell. Any
help appreciated

Sub Control_on_Worksheet()
Dim mypick As Variant
With Worksheets("Sheet1").DropDowns("my control")
mypick = .ListIndex
ActiveCell.Value = .List(mypick)
..Value = 0
End With
End Sub


--
lozc
------------------------------------------------------------------------
lozc's Profile: http://www.excelforum.com/member.php...o&userid=31340
View this thread: http://www.excelforum.com/showthread...hreadid=510269

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default duplicate listbox selection to range of cells?

You could get 12 consecutive cells with:

ActiveCell.Resize(12, 1).Value = .List(mypick)

But how do you know when to stop?

lozc wrote:

Is is possible to amend the following macro, so that a listbox selection
is copied to a range of consecutive cells? Yes that's right! For
scheduling purposes I need exactly the same value copied to each cell.
The macro listed below only copies the selection to the active cell. Any
help appreciated

Sub Control_on_Worksheet()
Dim mypick As Variant
With Worksheets("Sheet1").DropDowns("my control")
mypick = .ListIndex
ActiveCell.Value = .List(mypick)
Value = 0
End With
End Sub

--
lozc
------------------------------------------------------------------------
lozc's Profile: http://www.excelforum.com/member.php...o&userid=31340
View this thread: http://www.excelforum.com/showthread...hreadid=510269


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default duplicate listbox selection to range of cells?


Thanks Dave,

That was certainly useful, but I am looking for the value to be
duplicated to a set range of consecutive horizontal cells (eg A1:G1),
rather than consecutively from the current active cell, any ideas?

Thanks Again


--
lozc
------------------------------------------------------------------------
lozc's Profile: http://www.excelforum.com/member.php...o&userid=31340
View this thread: http://www.excelforum.com/showthread...hreadid=510269

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default duplicate listbox selection to range of cells?

ActiveCell.Resize(1, 7).Value = .List(mypick)
or
ActiveSheet.Range("a1:g1").Value = .List(mypick)

lozc wrote:

Thanks Dave,

That was certainly useful, but I am looking for the value to be
duplicated to a set range of consecutive horizontal cells (eg A1:G1),
rather than consecutively from the current active cell, any ideas?

Thanks Again

--
lozc
------------------------------------------------------------------------
lozc's Profile: http://www.excelforum.com/member.php...o&userid=31340
View this thread: http://www.excelforum.com/showthread...hreadid=510269


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default duplicate listbox selection to range of cells?


perfect! Thanks again


--
lozc
------------------------------------------------------------------------
lozc's Profile: http://www.excelforum.com/member.php...o&userid=31340
View this thread: http://www.excelforum.com/showthread...hreadid=510269



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
protect cells after listbox selection Chay Excel Discussion (Misc queries) 2 December 2nd 06 11:32 PM
protect cells after listbox selection Chay Excel Discussion (Misc queries) 3 December 1st 06 11:56 AM
protect cells after listbox selection Chay Excel Discussion (Misc queries) 0 November 30th 06 06:50 PM
protect cells after listbox selection Chay Excel Discussion (Misc queries) 0 November 30th 06 06:49 PM
protect cells after listbox selection JLatham Excel Discussion (Misc queries) 0 November 30th 06 03:00 PM


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