Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2003, 02:59 AM
Registered User
 
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default excel: Extracting only selected cells.

hello ALL :D,

i have this problem that i cannot find the solution. i want to extract only selected cells but right now i extract all the unwanted cells. is there a program or functions that i can extract a range of data? please help me.

thanks and regards,
rachel

 
Old July 17th, 2003, 03:12 AM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will need to clarify your request a bit... What exactly do you mean by "extract"?
 
Old July 18th, 2003, 02:24 AM
Registered User
 
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i want to extract only particular cells. now i extract out some of the unwanted cells. what i mean by "extract" is by selecting and copying only the selection that i want, without copying the unwanted cells.

 
Old July 21st, 2003, 08:07 PM
Registered User
 
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rachel:
You will have to help me.
Which cells are you extracting from? (e.g. is it a whole column or a particular range)?
What condition are you using to select (or reject) cells? (e.g. is zero; or is > 25)?
Are you doing this directly within Excel or are you using VBA?

Can you describe what you intend to happen and the environment within which it happens?

From what you have written so far it looks as though you might be wanting to scan a group (range) of cells and, if the content of the cell satisfies a particular condition, copy its contents to another cell; otherwise ignore it. Is that the scenario?

Alf
 
Old July 21st, 2003, 09:21 PM
Registered User
 
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which cells are you extracting from? (e.g. is it a whole column or a particular range)?
-particular range from a given condition.

What condition are you using to select (or reject) cells? (e.g. is zero; or is > 25)?
-select cells according to the dates given.

Are you doing this directly within Excel or are you using VBA?
-im using VBA.

Can you describe what you intend to happen and the environment within which it happens?
-the first thing to do is to refer to the given date from a cell. then from the given date, i need to find the match from a given row list dates. when the match is found, then the next step is to find the column list dates. when both are found and matched to the given date, then i need to copied the data within that two dates found and paste it into a new cell.

From what you have written so far it looks as though you might be wanting to scan a group (range) of cells and, if the content of the cell satisfies a particular condition, copy its contents to another cell; otherwise ignore it. Is that the scenario?
-yes you are right.

actually i have already done the program. it works correctly to what i want but the thing is that it extract the data together with the unwanted cells data. i only want the program to copy the exact data cells. so at this stage, i need your help to edit my program i presume. it would be better if i can send you a copy of my file so that you can have a better understanding to what i actually post. is there any way that i can attached you my file?

 
Old July 22nd, 2003, 12:55 AM
Registered User
 
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

these are my codes:
Sub get_data8()

      Dim dteDateIn As Date

     dteDateIn = Range("A32").Value
     Range("G4").Select
     Range(Selection, Selection.End(xlToRight)).Select

     For Each testcell In Selection
     If dteDateIn = testcell.Value Then
       NextFourForward = Range(Cells(4, testcell.Column + 0), Cells(4, testcell.Column + 3)).Select
       Range(Selection, Selection.End(xlDown)).Select
       Selection.Copy
       Range("B33").Select
       ActiveSheet.Paste
     Exit For
     End If

    Next testcell

     Range("E5").Select
     Range(Selection, Selection.End(xlDown)).Select

     For Each testcell In Selection
     If dteDateIn = testcell.Value Then
       NextFourUpward = Range(Cells(testcell.Row - 0, 5), Cells(testcell.Row - 3, 5)).Select
       Range(Selection, Selection.End(xlToRight)).Select
       Selection.Copy
       Range("a34").Select
       ActiveSheet.Paste
     Exit For
     End If

    Next testcell
    Cells(33, 1).Select

End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling copy function for selected cells yatinjhamb Excel VBA 3 March 21st, 2008 04:01 AM
Extracting data from excel spreadsheets Neil1234567 Access VBA 2 October 16th, 2007 07:28 AM
merging excel cells anoopkpanicker Beginning VB 6 1 March 26th, 2007 05:11 PM
merging excel cells in vb lip13 Beginning VB 6 1 December 30th, 2004 04:48 PM
Problem extracting DB contains to EXCEL mekh Pro PHP 4 March 30th, 2004 05:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.