LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
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
Event (BeforeSave) - How to test VBA code? Dave P. can you hear me now? EagleOne Excel Discussion (Misc queries) 3 September 14th 06 07:46 PM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM


All times are GMT +1. The time now is 08:20 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"