Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Joe
 
Posts: n/a
Default Macro wont run!

hi all,

Can someone pls tell me what is wrong with this code? (It just wont run
....)

I am trying to split data from worksheet "RAW data" into two worksheets
"IR data" and "FLS data", based on the length of the string in column A
of RAW data. The macro is intended to run until entry in column A
becomes empty.

Sub splitdata()
Dim i As Variant
Dim j As Variant
Dim k As Variant
Dim a As Variant
Dim c As Range 'current
Dim n As Range 'next

Set c = Range("A2")

i = 2
j = 2
k = 2

Do While Not IsEmpty(c)
Set n = c.Offset(1, 0)
a = Len(Cells(i, "A"))
If a < 9 Then
IRdata!Range(Cells(j, "A"), Cells(j, "O")) =
RAWdata!Range(Cells(i, "A"), Cells(i, "O"))
j = j + 1
Else
FLSdata!Range(Cells(k, "A"), Cells(k, "O")) =
RAWdata!Range(Cells(i, "A"), Cells(i, "O"))
k = k + 1
End If
i = i + 1
Set c = n
Loop
End Sub


Thnx,

Joe.

 
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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Can T Get Macro To Run! Nipper New Users to Excel 2 November 4th 05 04:48 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


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