View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default A real cut and paste

I think the idea may be to go from the bottom up. Try this idea.

Sub findprevious()
Do Until fc = " "
Set fc = Worksheets("Sheet2").Columns("a").findprevious(aft er:=Cells(500,
1))

'not quite sure what you want here?
[fc].Cut [fc].Offset(, 8)

Loop
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Send ME a sample workbook if desired along with before and after examples.
Pls TOP post in this group

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
ups.com...
On Jul 9, 9:44 am, "Don Guillett" wrote:
try
Sub cutpaste()
On Error GoTo timetoquit
With Worksheets("sheet2").Range("A1:A500")
Set c = .Find("s", LookIn:=xlValues)

If Not c Is Nothing Then
firstAddress = c.Address
y = 1
Do
Range(c.Offset(0, 0), c.Offset(3, 1)).Cut Cells(y, 3)

' Range(c.Offset(0, 0), c.Offset(3, 1)).Copy
' Range(Cells(y, 3), Cells(y, 4)).PasteSpecial
Set c = .FindNext(c)
y = y + 4

Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
timetoquit:
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

oups.com...



So far I have looked at many examples and i have tried many ways but I
have yet to figure out how to do a real cut and paste. So far in all
my codes I have been able to do a copy and paste and then a delete
selction but I can't this time. So hopefully someone can help me out.
My code is as follows...

With Worksheets(1).Range("A1:A500")
Set c = .Find("Substrate # 2", LookIn:=xlValues)

If Not c Is Nothing Then
firstAddress = c.Address
y = 1
Do
Range(c.Offset(0, 0), c.Offset(3, 1)).Copy
Range(Cells(y, 3), Cells(y, 4)).PasteSpecial
Set c = .FindNext(c)
y = y + 4

Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

I want it to cut and paste rather than copy and paste. I have tried
taking out the copy replacing it with a cut didn't work then tried
setting the ranges and ranges using the Dim function. I need help
please.- Hide quoted text -

- Show quoted text -


that does not work it only cuts and pastes once for each substrate. It
doesn't loop the cut and paste.