Hi all,
Using the following code to scan through a spreadsheet to select specific values and then copy a range of data to a blank sheet. I have about 6 or 7 chunks of this code in one module for different values. Is there an easier way to do this? Also if the value does not exist to run bombs out when it reaches the bottom of the spreadsheet.
-------------------------------------
Range("H2"
.Select
Do Until ActiveCell.Value = 45860
movedown
Loop
Selection.End(xlToLeft).Select
ActiveCell.Name = "StartCell"
For i = 1 To 7
moveright
Next i
Do While ActiveCell.Value = 45860
movedown
Loop
moveright
moveup
ActiveCell.Name = "EndCell"
Range("StartCell", "EndCell"
.Select
Selection.Copy
Range("A2"
.Select
Windows("blank.XLS"
.Activate
ActiveSheet.Paste
Do Until ActiveCell.Value = ""
movedown
Loop
Windows("source.xls"
.Activate
------------------------------------
Any help would be great...
Using the following code to scan through a spreadsheet to select specific values and then copy a range of data to a blank sheet. I have about 6 or 7 chunks of this code in one module for different values. Is there an easier way to do this? Also if the value does not exist to run bombs out when it reaches the bottom of the spreadsheet.
-------------------------------------
Range("H2"
Do Until ActiveCell.Value = 45860
movedown
Loop
Selection.End(xlToLeft).Select
ActiveCell.Name = "StartCell"
For i = 1 To 7
moveright
Next i
Do While ActiveCell.Value = 45860
movedown
Loop
moveright
moveup
ActiveCell.Name = "EndCell"
Range("StartCell", "EndCell"
Selection.Copy
Range("A2"
Windows("blank.XLS"
ActiveSheet.Paste
Do Until ActiveCell.Value = ""
movedown
Loop
Windows("source.xls"
------------------------------------
Any help would be great...