Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Find and export

Hi...

Each week I have an excel spreadsheet to work on that
requires me to find speficic values, and the rows on
which they appear need to exported to a new excel work
book (not a sheet).

Ideally I'm looking for a macro button that launches an
input box into which for example I type the word London.
Wherever the word London is found I want the rows on
which London is found to to be exported to a new workbook
in a block (no blank rows) format. Where rows have been
deleted on the original workbook cells are to be moved
upwards.

Can anyone help me with this?

Yours graciously

Gordon.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Find and export

Gordon,

Below is code that will extract your records to a new workbook. The
database is assumed to be the block of cells contiguous with cell A1 of the
activesheet of the activeworkbook, and the extraction is based on the value
you enter when prompted. The extract is based on the values in column C
(the Field:=3 part).

If you need help modifying the code, post back.

HTH,
Bernie
MS Excel MVP

Sub ExtractPartOfDataBase()
Dim myBk1 As Workbook
Dim myBk2 As Workbook

Set myBk1 = ActiveWorkbook
Set myBk2 = Workbooks.Add

With myBk1.ActiveSheet.Range("A1").CurrentRegion
.AutoFilter Field:=3, _
Criteria1:=Application.InputBox("Enter Key Word")
.SpecialCells(xlCellTypeVisible).Copy _
myBk2.Sheets(1).Range("A1")
.AutoFilter
End With

myBk2.SaveAs Application.GetSaveAsFilename _
(, "Excel Files (*.xls), *.xls")
End Sub


"Jack" wrote in message
...
Hi...

Each week I have an excel spreadsheet to work on that
requires me to find speficic values, and the rows on
which they appear need to exported to a new excel work
book (not a sheet).

Ideally I'm looking for a macro button that launches an
input box into which for example I type the word London.
Wherever the word London is found I want the rows on
which London is found to to be exported to a new workbook
in a block (no blank rows) format. Where rows have been
deleted on the original workbook cells are to be moved
upwards.

Can anyone help me with this?

Yours graciously

Gordon.



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
Export Excel tuncating leading zeros while export to excel from da RHBKV Setting up and Configuration of Excel 1 July 15th 09 01:48 PM
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
export re-order input fields to export file [csv] madisonpete Excel Worksheet Functions 0 November 30th 07 03:51 PM
export find results Amir Excel Discussion (Misc queries) 2 November 15th 05 03:01 PM
Find paragraphs in word and export to Excel Matt Shaw Excel Programming 1 July 19th 03 09:22 AM


All times are GMT +1. The time now is 04:58 PM.

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"