codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Extracting selected cells in excel  Archive Import (rachel) at 05:15 on Tuesday, July 22, 2003
 

hi all ,

i have this problem on my program codes that im not sure how to edit it. i want to extract only selected cells but my program codes extract the unwanted cells too. please help me on this.

these are the codes that i have done.
im not sure how to write the programs codes lines with condition apply if i want to select only the data within the range from the column date found to the row date found that match the given date.


code:
--------------------------------------------------------------------------------

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
-----------------------------------------

Thank you and regards,
Rachel









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  parent.Resize() in multi tabbed IE window
•  Re: How to Remove the URL`s from printouts
•  Re: 2 or more scripts
•  Re: query can we
•  Re: Disbale edit
•  Re: How to get all the properties values of an object
•  Re: Catalog
•  Re: DHTML drop down menu
•  Re: Where do I find source code on this site?


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010