View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Macro that worked stopped working

Try this. Keep in mind it has no error checking in it if the worksheets
don't exist.

Option Explicit
Sub Test()
Dim myWB As Excel.Workbook
Dim myWS As Excel.Worksheet
Dim mySourceWS As Excel.Worksheet
Dim myRange As Excel.Range

Set myWB = ThisWorkbook
Set myWS = myWB.Sheets("Serial Number Log")
Set myRange = myWS.Cells(1, 1).End(xlDown).Offset(1, 0)

Set mySourceWS = myWB.Sheets("DO NOT DELETE")
mySourceWS.Range("G54").Copy

myRange.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False

myRange.Offset(0, 23).Copy
With myWB.Sheets("Work Order Form").Range("H25")
.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End With

End Sub

Untested!

HTH,
Barb Reinhardt

"Freddy" wrote:

I have the following that has worked for months and now has stopped? Is
there some limit? It basically takes a number (Fixed digits like 1234 + a
calculated part) and pastes it into a cell.

Sheets("Serial Number Log").Select
Range("A1").End(xlDown).Offset(1, 0).Select
Sheets("DO NOT DELETE").Select
Range("G54").Select
Selection.Copy
Sheets("Serial Number Log").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 23).Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Work Order Form").Select
Range("H25").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False