LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Dynamic Selection Find Function

Hi Sir,

i am trying to find active cell value(Testing) from a column set of data but
when it comes to line:

Testing = Cells(i, 2).Value

Selection.Find(What:=Testing, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

it cannot continue to run the rest of the macro? why? Other than selection
find function, is there any other alternate function to obtain the same
results? Thanks.



Example:

Sub Reschedule()

Range("A1").Select
With Application
.Calculation = xlAutomatic
End With
With Application
.ReferenceStyle = xlA1
End With


Range("A1").Select
NumOfRows = Cells(Rows.Count, 1).End(xlUp).Row

Workbooks.Open Filename:="G:\Asia\Product\Operations\Part
Adjustments\VSJ Reschedule\vsj.xls"
Windows("vsj.xls").Activate

Windows("VSJ Reschedule1.xls").Activate
Sheets.Add

Windows("vsj.xls").Activate
Sheets("vsj").Select
Application.CutCopyMode = False
Sheets("vsj").Copy After:=Workbooks("VSJ Reschedule1.xls").Sheets(2)
ActiveWindow.SmallScroll Down:=-15


Windows("VSJ Reschedule1.xls").Activate
Sheets("Sheet1").Select


i = ActiveCell.Row

Testing = Cells(i, 2).Value

Range("B2").Select
For i = 2 To NumOfRows

If Not IsError(Testing) Then

ActiveCell.Select
Selection.Copy

Sheets("vsj").Select
Columns("F:F").Select

Selection.Find(What:=Testing, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

ActiveCell.EntireRow.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

End If

Next i

MsgBox ("Please run Macro2 after filling in all info")

End Sub






 
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
Dynamic Range Selection Using VBA TEK Excel Discussion (Misc queries) 2 January 23rd 10 04:55 AM
dynamic selection of cells parthaemail New Users to Excel 1 April 25th 06 12:13 PM
Dynamic range selection Fernando Ronci Excel Programming 1 August 4th 04 10:37 PM
Dynamic Cell Selection Rwem Excel Programming 3 August 1st 04 04:44 PM
Dynamic Row Selection Bruce B[_2_] Excel Programming 4 July 14th 03 09:14 PM


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

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"