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

Hey.. I need some help..

I have to filter the values of one collumm according to the value on another
cell on another workbook, than I have to copy and past it in a third workbook.

I am trying this code.. but I doesnt work, It did not recognize the value on
the cell...

help meeee!!!

The code:

Windows("Prazos de entrega_matriz").Activate 'it's the first workbook.
Sheets("Extract BD").Select
Windows("" & Sheets("Extract BD").Range("R7") & ".xls").Activate 'it
activate the second workbook. The one who has the parameter to filter the
values
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:='[Prazos de
entrega_matriz.xls]Extract BD'!$L$7 'that's the address of the cell with the
name of the value to be filtered in the second workbook.
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Windows("" & Sheets("Extract BD").Range("O7") & ".xls").Activate 'it
activate the third workbook.
Range("B2").Select
ActiveSheet.Paste
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default VBA problem.

If desired, send your file ( S ) to my address below. I will only
look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dani Lima" wrote in message
...
Hey.. I need some help..

I have to filter the values of one collumm according to the value on
another
cell on another workbook, than I have to copy and past it in a third
workbook.

I am trying this code.. but I doesnt work, It did not recognize the value
on
the cell...

help meeee!!!

The code:

Windows("Prazos de entrega_matriz").Activate 'it's the first workbook.
Sheets("Extract BD").Select
Windows("" & Sheets("Extract BD").Range("R7") & ".xls").Activate 'it
activate the second workbook. The one who has the parameter to filter the
values
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:='[Prazos de
entrega_matriz.xls]Extract BD'!$L$7 'that's the address of the cell with
the
name of the value to be filtered in the second workbook.
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Windows("" & Sheets("Extract BD").Range("O7") & ".xls").Activate 'it
activate the third workbook.
Range("B2").Select
ActiveSheet.Paste


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default VBA problem.

Did you intend to activate cell R7, but then try to sort on L7? Have you
verified that the data in L7 is a valid sort criteria?

you also seem to have an extra ".xls" at the end of the third line?

For easy of following the code (and troubleshooting) you might consider
setting a variable to the value you want to pass from workbook1 to workbook2;

(aircode)

Windows("Prazos de entrega_matriz").Activate
MySortValue = Sheets("Extract BD").Range("R7").value

'activate the second workbook
Windows("second workbook name").Activate
Sheets("sheetname").activate
Activesheet.Range("E3").Select
Activesheet.Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:=MySortValue
etc.

"Dani Lima" wrote:

Hey.. I need some help..

I have to filter the values of one collumm according to the value on another
cell on another workbook, than I have to copy and past it in a third workbook.

I am trying this code.. but I doesnt work, It did not recognize the value on
the cell...

help meeee!!!

The code:

Windows("Prazos de entrega_matriz").Activate 'it's the first workbook.
Sheets("Extract BD").Select
Windows("" & Sheets("Extract BD").Range("R7") & ".xls").Activate 'it
activate the second workbook. The one who has the parameter to filter the
values
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:='[Prazos de
entrega_matriz.xls]Extract BD'!$L$7 'that's the address of the cell with the
name of the value to be filtered in the second workbook.
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Windows("" & Sheets("Extract BD").Range("O7") & ".xls").Activate 'it
activate the third workbook.
Range("B2").Select
ActiveSheet.Paste

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default VBA problem.

Hey.. thanks.. worked perfectly..

Dani

"ker_01" wrote:

Did you intend to activate cell R7, but then try to sort on L7? Have you
verified that the data in L7 is a valid sort criteria?

you also seem to have an extra ".xls" at the end of the third line?

For easy of following the code (and troubleshooting) you might consider
setting a variable to the value you want to pass from workbook1 to workbook2;

(aircode)

Windows("Prazos de entrega_matriz").Activate
MySortValue = Sheets("Extract BD").Range("R7").value

'activate the second workbook
Windows("second workbook name").Activate
Sheets("sheetname").activate
Activesheet.Range("E3").Select
Activesheet.Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:=MySortValue
etc.

"Dani Lima" wrote:

Hey.. I need some help..

I have to filter the values of one collumm according to the value on another
cell on another workbook, than I have to copy and past it in a third workbook.

I am trying this code.. but I doesnt work, It did not recognize the value on
the cell...

help meeee!!!

The code:

Windows("Prazos de entrega_matriz").Activate 'it's the first workbook.
Sheets("Extract BD").Select
Windows("" & Sheets("Extract BD").Range("R7") & ".xls").Activate 'it
activate the second workbook. The one who has the parameter to filter the
values
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:='[Prazos de
entrega_matriz.xls]Extract BD'!$L$7 'that's the address of the cell with the
name of the value to be filtered in the second workbook.
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Windows("" & Sheets("Extract BD").Range("O7") & ".xls").Activate 'it
activate the third workbook.
Range("B2").Select
ActiveSheet.Paste

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default VBA problem.

Hey Ker.. I am trying to rate your post but It seems to have a problem.. It
still appears unrated to me..

"Dani Lima" wrote:

Hey.. thanks.. worked perfectly..

Dani

"ker_01" wrote:

Did you intend to activate cell R7, but then try to sort on L7? Have you
verified that the data in L7 is a valid sort criteria?

you also seem to have an extra ".xls" at the end of the third line?

For easy of following the code (and troubleshooting) you might consider
setting a variable to the value you want to pass from workbook1 to workbook2;

(aircode)

Windows("Prazos de entrega_matriz").Activate
MySortValue = Sheets("Extract BD").Range("R7").value

'activate the second workbook
Windows("second workbook name").Activate
Sheets("sheetname").activate
Activesheet.Range("E3").Select
Activesheet.Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:=MySortValue
etc.

"Dani Lima" wrote:

Hey.. I need some help..

I have to filter the values of one collumm according to the value on another
cell on another workbook, than I have to copy and past it in a third workbook.

I am trying this code.. but I doesnt work, It did not recognize the value on
the cell...

help meeee!!!

The code:

Windows("Prazos de entrega_matriz").Activate 'it's the first workbook.
Sheets("Extract BD").Select
Windows("" & Sheets("Extract BD").Range("R7") & ".xls").Activate 'it
activate the second workbook. The one who has the parameter to filter the
values
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:='[Prazos de
entrega_matriz.xls]Extract BD'!$L$7 'that's the address of the cell with the
name of the value to be filtered in the second workbook.
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Windows("" & Sheets("Extract BD").Range("O7") & ".xls").Activate 'it
activate the third workbook.
Range("B2").Select
ActiveSheet.Paste

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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with a conditional max problem Brian Cornejo Excel Discussion (Misc queries) 1 February 18th 05 06:25 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


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