Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hallo,
I have the next macro, but it gives me an error message: "Run-time error 1004: Method 'Range' of object '_Worksheet' failed". I need a variable range in batches of 96 rows, but I think I defined it wrong. Please help me. Sub Abs_Bkg2() Dim rng As Range Dim lRownum As Long Dim i As Long Dim j As Long Dim exSh As Worksheet Dim wks As Worksheet Set exSh = Worksheets("raw data from spad it") Set wks = Worksheets("Calculated Data") lRownum = exSh.Range("A1").SpecialCells(xlCellTypeLastCell). Row i = (lRownum - 1) / 96 For j = 1 To i With wks.Range("V[j*96-94]:Y[j*96+1]") .FormulaR1C1 = _ "='raw data from spad it'!RC[-7]-'Calculated Data'!R4C[16]" End With Next j End Sub Thanks, - Metin - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Variable in range | Excel Programming | |||
variable range: l just can't get there! | Excel Programming | |||
Variable Range | Excel Programming | |||
Problem trying to us a range variable as an array variable | Excel Programming |