Is this possible?

MrData

Active Member
Joined
May 4, 2003
Messages
324
Have to admit defeat and conract you people at MrExcel again. Have done a number of searches and am unable to find a solution.

I have a spreadsheet that has many rows of data with approximatly 30 columns being used.

In cell AZ1 there is a value that can be amended. Depending on the value in this cell I would like to filter the rows that match this value (column B is where they will match)

Based on this I would like to use a userform to update the contents of the rows that have been filtered. The updating will be done on a manual basis.

I know this is possible in Access but I need a similar solution using Excel. Can anyone please help a desperate person?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi, MrData,

For the first part of your question:

When you record a macro and then autofilter you get something like
Selection.AutoFilter Field:=1, Criteria1:="b"

This can bring you to the code
Columns(2).AutoFilter Field:=1, Criteria1:=Range("AZ1")

For the second part (Userform etc...) you could give more details ...

kind regards,
Erik
 
Upvote 0
Thanks I can follow the code that you have supplied. With regard to the second part here goes. I currently have a userform (with lists, combo box etc.) which places data in a spreadsheet. An identifier is also entered that links various rows of data together. This can be found in column B and can appear on more than one instance.

I need a second user form that will bring up the rows of data in order so that they can be amended in a userform. The amended records then need to overwrite the original data. I've seen something in Access, but we only use Excel in work so its got to be in Excel format.

Example: The spreadsheet has 43,000 rows of data. The identifier in column B reads 0003 and by filtering this shows 10 rows. Somehow I need a Useform to show these 10 rows (column A:AF), allow the user to update manually and for the original data to over written.

Hope this explains things better, if not let me know and I'll try again.
 
Upvote 0
OK,

You need to "feed" listboxes. (Listbox.Additem ...) There are numerous threads on that: search for "populating listbox".

You need to populate with only the visible cells:
Range("yourrange").SpecialCells(xlCellTypeVisible)
unfortunately I didn't get it to work with this feature
but this example is working
it selects the visible rows within a range
Code:
Sub select_visible_rows_in_range()
Dim cc As Integer
Dim rrr As Range
Dim i As Integer

cc = Range("yourrange").Columns.Count
Set rrr = Range("yourrange")

    For i = 1 To rrr.Cells.Count Step cc
      If rrr(i).EntireRow.Hidden = False Then
      rrr(i).Resize(1, cc).Select
      Application.Wait Now + TimeValue("00:00:01")
      End If
    Next i
End Sub

you could adapt this code or another to feed your listbox

does this give you a start?

kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,203,628
Messages
6,056,414
Members
444,862
Latest member
more_resource23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top