Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Macro that worked stopped working

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro that worked stopped working

I'm not sure why it stopped??

But I think that this does the same thing.

Dim NextCell as range

with worksheets("serial number log")
set nextcell = .range("A1").end(xldown).offset(1,0)
end with
nextcell.value = worksheets("do not delete").range("g54").value

worksheets("work order form").range("H25").value = nextcell.offset(0,23).value



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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
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
Spreadsheet macro stopped working! Anders[_2_] Excel Discussion (Misc queries) 5 November 22nd 09 05:28 PM
Macro stopped working Ed Davis[_2_] Excel Discussion (Misc queries) 5 October 7th 09 11:46 PM
Macro Suddenly Stopped Working [email protected] Excel Programming 4 May 1st 07 08:55 PM
Macro has stopped working!!! Jim Cone Excel Programming 2 January 8th 07 01:28 AM
why did the macro stopped working? Martyn Excel Programming 12 April 21st 04 03:29 PM


All times are GMT +1. The time now is 10:41 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"