Hi all
I've made a module for organizing special types of input at work. after several problems I finally found a way to make it work - Then I made it into a template and it still worked all right.... Know I need to use it again and all of a sudden I'm getting a "range" error on object "worksheet".... WHY???
My code is very simple, since I'm using processing sheets, thus I'm merely copy/pasting... Code as follows;
VB Code:
Sub flexvalue() Dim j As Double Dim k As Double Dim iSheet As Worksheet Dim nSheet As Worksheet Dim rSheet As Worksheet Dim nkSheet As Worksheet Set iSheet = ActiveWorkbook.Sheets("Input") Set nSheet = ActiveWorkbook.Sheets("Nedskrivning-Lån") Set rSheet = ActiveWorkbook.Sheets("Resultater") Set nkSheet = ActiveWorkbook.Sheets("Nedskrivning-Kredit") Application.ScreenUpdating = False nSheet.Activate For j = 2 To 10000 nSheet.Cells(20, 16).Value = iSheet.Cells(j, 16).Value iSheet.Activate If iSheet.Range(Cells(j, 16), Cells(j, 16)).Value > 0 Then iSheet.Range(Cells(j, 1), Cells(j, 1)).Copy rSheet.Activate rSheet.Range(Cells(j, 1), Cells(j, 1)).PasteSpecial Paste:=xlValues iSheet.Activate iSheet.Range(Cells(j, 3), Cells(j, 5)).Copy rSheet.Activate rSheet.Range(Cells(j, 2), Cells(j, 4)).PasteSpecial Paste:=xlValues
and so forth...
As I said - used to work, now it doesn't?
/Nick




Reply With Quote