Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 26th, 2005, 09:52 PM
A10 Instructor A10 Instructor is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 1 A10 Instructor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 43 sec
Reputation Power: 0
Question Excel macro and "months"

Hi!
I'm new to macro coding and need some help.

I have an excel sheet that has cell B3 filled with a month (i.e. December). I also have an existing macro for that sheet that, when ran, will move data from one column to another column then clearing the original column. I would also like to have the same macro recognize the month already resident in cell B3, and increment that content to the next month when the macro is ran.
In other words, cell B3 contains the month "December". When I run the macro, it reads cell B3, then increments the month such that cell B3 will now read the month "January".

Here is the macro code I have currently:

Sub UPDATE()
'
' UPDATE Macro
' Macro created by 373 TRS
'

'
Sheets("43 MXS").Select
Range("D4:F41").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("C4").Select
ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
Range("F4").Select
ActiveCell.FormulaR1C1 = "0"
Range("F4:F41").Select
Selection.ClearContents
Range("F4").Select
Sheets("2 AS").Select
Range("D4:F41").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("C4").Select
ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
Range("F4").Select
ActiveCell.FormulaR1C1 = "0"
Range("F4:F41").Select
Selection.ClearContents
Range("F4").Select
Sheets("41 AS").Select
Range("D4:F41").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("C4").Select
ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
Range("F4").Select
ActiveCell.FormulaR1C1 = "0"
Range("F4:F41").Select
Selection.ClearContents
Range("F4").Select
Sheets("743 MXS").Select
Range("D4:F41").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("C4").Select
ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
Range("F4").Select
ActiveCell.FormulaR1C1 = "0"
Range("F4:F41").Select
Selection.ClearContents
Range("F4").Select
Sheets("TDY").Select
Range("D4:F41").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("C4").Select
ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
Range("F4").Select
ActiveCell.FormulaR1C1 = "0"
Range("F4:F41").Select
Selection.ClearContents
Range("F4").Select
Sheets("898").Select
Range("J9:J236").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("I9:I236").Select
Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.IndentLevel = 0
.ShrinkToFit = False
End With
Range("L9:L236").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("J9:J236").Select
Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Range("L9:L236").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("N9:N236").Select
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("M9:M236").Select
Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Range("O9:O236").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.LargeScroll Down:=-3
Range("N9:N236").Select
Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Range("O9:O236").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("P9:Q13").Select
End Sub


Any help will be greatly appreciated.

Thanks

A10 Instructor

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Excel macro and "months"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT