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: 1
Default Excel problem - why won't my macro work?

I am a beginner at these things, so hopefully it's a simple error I've
made.

I have an excel workbook. On the first page is a master list of
documents, with column G containing a letter denoting the status of the
document (C for current, D for deleted etc.)

I regularly need to issue people with up to date lists of current and
deleted documents, so I wrote this macro to copy the relevant entries
onto seperate worksheets. At the moment it's only looking for Current
entries, but it just won't work.

Anyone have any idea why not? Please tell me it's simple....



Private Sub Worksheet_Activate()

Dim num As String

For i = 2 To 150

num = i

If Worksheets("MASTER LIST").Cells(i, 5) = "C" Then

Range("A" & num:"G" & num).Select

Selection.copy

Sheets("CURRENT ").Select

Range("A" & num).Select

ActiveSheet.Paste

Else

'messagebox is only here for my testing purposes, and will be
'deleted once the macro is working

MsgBox ("Not current")

End If

Next i

End Sub


---
Message posted from http://www.ExcelForum.com/

 
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
Macro to update a column in a work based on another work sheet WickerMan New Users to Excel 1 December 4th 09 12:58 PM
Problem with Excel: Simple multiplying calculations don't work. dforty3 Excel Discussion (Misc queries) 3 July 22nd 05 05:47 PM
problem to work out with excel sheet raj Excel Worksheet Functions 1 December 27th 04 08:07 AM
Problem getting excel to work in Visual Studio (C#) Harald Antonsen Excel Programming 5 December 1st 03 05:04 PM
Excel Macro Problem, Add-in need to work in every workbook & Error:9 Subscript out of range Burak[_2_] Excel Programming 1 October 31st 03 08:09 PM


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