LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default How do I read this VBA code?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB code to tell if my sheet is read-only Kevin Excel Discussion (Misc queries) 1 January 10th 08 12:28 AM
VBA code to read formular from another cell fLiPMoD£ Excel Discussion (Misc queries) 1 April 25th 07 12:12 AM
How do I read this VBA code? [email protected] Excel Discussion (Misc queries) 1 November 21st 06 08:44 PM
Adding read receipt to CDO code? [email protected] Excel Programming 1 January 12th 06 07:30 PM
read macro code by vb code Francesco Geri Excel Programming 2 October 7th 05 10:24 AM


All times are GMT +1. The time now is 05:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"