View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John[_78_] John[_78_] is offline
external usenet poster
 
Posts: 87
Default What's the Difference Q

What is the difference in running code within the 'This Workbook' routine
and a standard module?

I have code that is currently within the 'This Workbook' which fires on
opening - works great, comes back with the correct everything, yet when I
place the same exact same code within a standard module try to run it, a
specific part of the code does not run, that code from -
"Range("S2.S2").Copy" down - all I see is the cell highlighted as happens
when you select a cell to copy. Have I found a MS bug or what? The offending
code is as follows and is doing my head in! I can run this code on its own
and it WORKS, when I try to call it from my original macro - nothing
happens. The sheet isn't protected, I'm lost

Range("S2").Select
ActiveCell.Formula = "=PROPER(F2&"" ""&G2)"
Range("S2.S2").Copy
x = 2
Do Until Cells(x, 7).Value = ""
Cells(x, 19).PasteSpecial xlPasteFormulas
x = x + 1
Loop