Old 05-11-2007   #1 (permalink)
Banned
 
Join Date: Jun 2006
Location: Melbourne y0 Reputation: Awesome Targeting: snow
Posts: 3,424
Rep Power: 0
Default VB Script HELP!!

OK.. So I'm terrible at everything. The same goes for VB Scripting. I am an absolute newbie to this stuff. Basically I am trying to write a macro to hook two files together for Excel. One File has a check box which shows the status of a job. The other Excel file is a compiled list of all jobs from the other file which have been ticked off (using the checkbox) to notify the user the job has been completed..

Firstly, I have done my best to write something that does this. It works, however its specific to one checkbox and therefore one job. I have thousands of checkboxes. How can I write a general code so that if a particular checkbox is ticked, the relevant information is copied.


Quote:
Sub Macro7()

Range("A5").Select
Selection.Copy
Windows("archive.xls").Activate
Range("A5109").Select
ActiveSheet.Paste
Windows("Compactus Storage Documents.xls").Activate
Range("B5").Select
Application.CutCopyMode = False
Selection.Copy
Windows("archive.xls").Activate
Range("B5109").Select
ActiveSheet.Paste
Range("B5109,A5109:C5109").Select
Range("A5109").Activate
Application.CutCopyMode = False
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Windows("Compactus Storage Documents.xls").Activate
End Sub
mONk. is offline   Reply With Quote
Old 07-11-2007   #2 (permalink)
Pro Member
 
chemicalNova's Avatar
 
Join Date: Jun 2006
Age: 19
Posts: 5,593
Rep Power: 8
Default

Control Arrays.

chem
__________________
There are no stupid questions... but there are alot of inquisitive idiots.
-
chemicalNova is offline   Reply With Quote
Old 07-11-2007   #3 (permalink)
Banned
 
Join Date: Jun 2006
Location: Melbourne y0 Reputation: Awesome Targeting: snow
Posts: 3,424
Rep Power: 0
Default

Quote:
Originally Posted by chemicalNova View Post
Control Arrays.

chem
Looking it to it.

Thanks Pro.
mONk. is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


All times are GMT +10. The time now is 09:35 AM.


Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0