Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Filling An Autofiltered List

Hi, I have sheet called static data with some lists on. I
have a data sheet with a lot of data on it, against which
I am writing a value from the static data sheet, im doing
this by autofiltering the main data, then using a macro
im popping up a window with a list box in it with all the
items from the static data sheet, when I double click an
item from the list box its puts the value in the active
cell on the data sheet, I then have to manually copy the
value down the filtered list, is there anyway instead of
just pasting the list box value back to the active cell I
can paste it to all the cells for the current column that
are showing in the autofiltered list ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Filling An Autofiltered List

You want to put the same value in the visible cells of a filtered list???

Then maybe this'll get you started:

Option Explicit
Sub testme()

Dim rngF As Range
Dim myStr As String

'get your value in the listbox into mystr
myStr = "Hi there!"

With ActiveSheet.AutoFilter.Range
If .Columns(1).Cells.SpecialCells(xlCellTypeVisible). Count = 1 Then
'no visible cells, except for the header
Else
Set rngF = Nothing
On Error Resume Next
Set rngF = Intersect(ActiveCell.EntireColumn, _
.Offset(1, 0).Resize(.Rows.Count - 1)) _
.Cells.SpecialCells(xlCellTypeVisible)
On Error GoTo 0

If rngF Is Nothing Then
MsgBox "activecell not in autofilter range"
Else
rngF.Value = myStr
End If
End If
End With
End Sub

It populates all the visible cells in the filtered range (not the header row) in
the activcell's column.

It kind of sounded like that's what you're doing.

Neil wrote:

Hi, I have sheet called static data with some lists on. I
have a data sheet with a lot of data on it, against which
I am writing a value from the static data sheet, im doing
this by autofiltering the main data, then using a macro
im popping up a window with a list box in it with all the
items from the static data sheet, when I double click an
item from the list box its puts the value in the active
cell on the data sheet, I then have to manually copy the
value down the filtered list, is there anyway instead of
just pasting the list box value back to the active cell I
can paste it to all the cells for the current column that
are showing in the autofiltered list ?


--

Dave Peterson

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
Dynamic count on an Autofiltered list ttbbgg Excel Discussion (Misc queries) 3 February 13th 08 04:47 PM
Copy Results from Autofiltered List Kaye Excel Worksheet Functions 3 April 19th 07 02:39 AM
How to identify text from a autofiltered list using formulas Harryac Excel Worksheet Functions 1 July 13th 06 11:45 PM
Copying to an autofiltered list Phil Excel Discussion (Misc queries) 3 June 30th 05 02:08 PM
Filling An Autofiltered List Neil Excel Programming 0 August 2nd 04 03:05 PM


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