PC Review


Reply
Thread Tools Rate Thread

Copt data with specific criteria

 
 
Decreenisi
Guest
Posts: n/a
 
      28th Feb 2006
Following on from yesterday, I still haven't quite got the solution.
Because I may have not explained myself, sorry.

A B C D E F
1 2 Y N 6 6 8
2 2 N N 8 9 9
3 3 Y Y 6 7 3
4 3 N T 7 5 2
5 3 Y Y 5 7 6

In the above WB called rejects I have the following information. A1:A5
are week numbers. In WB called reports, I want to put a week Number in
A1 i.e 3. Then open WB rejects and select all data A3:F5, representing
all data for week 3. Then to copy it and paste is in WB reports from
cell A2. Then close WB rejects. Just to complicate matters, I would
like to paste the data using (Paste Special, values option.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFzb24=?=
Guest
Posts: n/a
 
      28th Feb 2006
the simplest solution is to record a macro and then say a variable holds the
value that you enter in the wb record, and use that variable in the recorded
macro instead of a static value.

like:,
dim hold as integer
hold = workbooks(reports).worksheets(sheet1?).range(A1).value
and now, use hold in the recorded macro..


"Decreenisi" wrote:

> Following on from yesterday, I still haven't quite got the solution.
> Because I may have not explained myself, sorry.
>
> A B C D E F
> 1 2 Y N 6 6 8
> 2 2 N N 8 9 9
> 3 3 Y Y 6 7 3
> 4 3 N T 7 5 2
> 5 3 Y Y 5 7 6
>
> In the above WB called rejects I have the following information. A1:A5
> are week numbers. In WB called reports, I want to put a week Number in
> A1 i.e 3. Then open WB rejects and select all data A3:F5, representing
> all data for week 3. Then to copy it and paste is in WB reports from
> cell A2. Then close WB rejects. Just to complicate matters, I would
> like to paste the data using (Paste Special, values option.
>
>

 
Reply With Quote
 
=?Utf-8?B?Q0xS?=
Guest
Posts: n/a
 
      28th Feb 2006
Here's a change-event macro that may do just what you want.........
Put it in the Worksheet module of the sheet you want it to work on and enter
your week number in A1.....it will fill in the data in B1:G1

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Range("b1").Formula = "='c:\[rejects.xls]sheet1'!b" & Range("a1").Value
Range("c1").Formula = "='c:\[rejects.xls]sheet1'!c" & Range("a1").Value
Range("d1").Formula = "='c:\[rejects.xls]sheet1'!d" & Range("a1").Value
Range("e1").Formula = "='c:\[rejects.xls]sheet1'!e" & Range("a1").Value
Range("f1").Formula = "='c:\[rejects.xls]sheet1'!f" & Range("a1").Value
Range("g1").Formula = "='c:\[rejects.xls]sheet1'!g" & Range("a1").Value
End Sub

Macro written in XL97

Vaya con Dios,
Chuck, CABGx3


"Decreenisi" wrote:

> Following on from yesterday, I still haven't quite got the solution.
> Because I may have not explained myself, sorry.
>
> A B C D E F
> 1 2 Y N 6 6 8
> 2 2 N N 8 9 9
> 3 3 Y Y 6 7 3
> 4 3 N T 7 5 2
> 5 3 Y Y 5 7 6
>
> In the above WB called rejects I have the following information. A1:A5
> are week numbers. In WB called reports, I want to put a week Number in
> A1 i.e 3. Then open WB rejects and select all data A3:F5, representing
> all data for week 3. Then to copy it and paste is in WB reports from
> cell A2. Then close WB rejects. Just to complicate matters, I would
> like to paste the data using (Paste Special, values option.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling specific Data from one WS to another WS based upon 1 criteria Cope Microsoft Excel Programming 1 8th Jun 2010 06:31 PM
More then one criteria to open a form with specific data Marco Microsoft Access Form Coding 3 19th Apr 2008 07:05 PM
Copy data to another wb based on specific criteria =?Utf-8?B?a3No?= Microsoft Excel Misc 1 29th Oct 2007 01:30 PM
Linking data that contains specific row criteria =?Utf-8?B?VGVyaQ==?= Microsoft Excel Worksheet Functions 1 5th Apr 2005 05:30 PM
LIKE criteria to return specific OR all data? Larry Microsoft Access Queries 2 8th Jan 2004 11:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:05 AM.