View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Anders S[_2_] Anders S[_2_] is offline
external usenet poster
 
Posts: 57
Default Ranges using offset

No typo, and I'm not Bob.

It looks like a line break has been inserted somewhere along the line.
".Column)).Delete" belongs to the line above it.

Try the macro by itself to make sure it works before you enter it into your
existing code

Regards
Anders Silven


"Fatir Zelen" skrev i meddelandet
...
Got a compile error at the .Column)) part - didn't use
option explicit or sub since inside existing code but I
dont think that should matter.

Was that a typo Bob?
-----Original Message-----
Fatir,

Try this

'-----
Option Explicit

Sub abc()
With Range("lastColumn")
.Offset(0, 1).Resize(Rows.Count, (Columns.Count -

.Column)).Delete
End With
End Sub
'-----

HTH
Anders Silven

"Fatir Zelen" skrev

i meddelandet
...
Let's say I have the following to delete the contents of
Column 68 to 256.

Sheets("Main").Select
Application.GoTo Reference:="C68:C256"
Selection.Delete Shift:=xlToLeft

but instead I want the reference to be from a named

range -
say "last_column" which is the number 67. How would I
change the above code to referenc the number in the

range
vs manually edititing the code? Looking for same help
with row (say "last_row" = 100)



.