Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet that contains VBA code, that basically re-arranges
an imported file. There are two tabs in the file, Raw Data and Actual Sign on Sign Off. The problem I have is that the code was not written by me and since then the imported data layout has changed. Main problem is that unless I highlight the blank cells and hit the Delete key the macro does not position the data correctly, but once I use the delete key it all works fine, I dont understand why this is. Here is the code in the VBA - if someone could first of all tell my what the code is trying to do (in simple terms) and how can I get around the problem of the data not positioning in the tab Actual Sign on Sign Off. Sub Signonoff() ' ' Sign On Off ' Macro recorded 09/10/2002 by pcond1 ' ' Application.ScreenUpdating = False Sheets("Actual Sign-on Sign-Off").Range("A2:R359").ClearContents k = 1 For l = 1 To 1500 If Sheets("Raw Data").Cells(l, 8) 0 Then k = k + 1 Sheets("Actual Sign-on Sign-Off").Cells(k, 1) = Sheets("Raw Data").Cells(l, 3) For i = 2 To 20 j = 2 * i If Sheets("Raw Data").Cells(l + i, 12) = "" Then Exit For Else Sheets("Actual Sign-on Sign-Off").Cells(k, -1 + j) = Sheets("Raw Data").Cells(l + i, 12) Sheets("Actual Sign-on Sign-Off").Cells(k, -2 + j) = Sheets("Raw Data").Cells(l + i, 10) End If Next i End If Next l Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB code to tell if my sheet is read-only | Excel Discussion (Misc queries) | |||
VBA code to read formular from another cell | Excel Discussion (Misc queries) | |||
How do I read this VBA code? | Excel Discussion (Misc queries) | |||
Adding read receipt to CDO code? | Excel Programming | |||
read macro code by vb code | Excel Programming |