View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Code Problem to end of column

Ric,

Column D is empty, so base your range on a filled in column, like C. And there is no need to
select....

Columns("D:D").Insert Shift:=xlToRight
Range("D1", Range("C65536").End(xlUp)(1, 2)).FormulaR1C1 _
= "=RC[-1]*100"

HTH,
Bernie
MS Excel MVP


"Rick" wrote in message
...
Below is my code that is intended to stop at the end of column D. As you can
see by the results below, the formula continues past the last row. Can
someone help determine where I am going wrong?
Ric

Columns("D:D").Select
Selection.Insert Shift:=xlToRight
ActiveCell.End(xlUp).Select
Range("D1", Range("D1").End(xlDown)).Select
'With Range("D1", Range("D1").End(xlDown)).Select
Selection.FormulaR1C1 = "=RC[-1]*100"
'End With

001102109480000558960 21061207 0000007353 0000735300
001102109480000558962 21061207 0000000295 0000029501
001102109480000558963 21061207 0000000128 0000012817
001102109480000558964 21061207 0000000102 0000010211
001102109480000558965 21061207 0000000350 0000035006
0000000000
0000000000
0000000000
0000000000