XP, Excel 2003, Hide Row + Create Row + Move boarder; Macro help

est1865

New Member
Joined
Sep 27, 2010
Messages
2
Hi all,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
First of all let me say what a great forum this place looks. As you can see by my post count I’m a brand new user. I have started a new job which will involve a degree of excel use and in an effort to make myself more productive I am trying to create a couple of macros. This forum came highly recommended to me by a friend to help me out.

Please be keep in mind though that I am a complete novice with excel macros (my attempts to do this myself have been pitiful) so I apologise in advance for my ignorance.
<o:p> </o:p>
I am using windows XP OS and Excell 2003.
<o:p> </o:p>
I have created a calendar type worksheet which is intended to be a “live” or “rolling document”. On this worksheet there are 26 columns which represent a half year overview of the projects I have currently ongoing at work. I have listed these in the rows. I have designed the worksheet to print to a A3 sheet of paper so I can print it off and stick it on my wall and see which projects are active when.
<o:p> </o:p>
In order to make myself more productive I would like to create a macro so that when I push a button the oldest week column is hidden (far left) and a new column is created on the right of the newest week column. I have also highlighted the current week (as I show the 26 weeks as 22 in advance and 4 in the past) with a think cell boarder for ease of reading. I would therefore like the macro to move this think boarder to the column to the right to represent the week moving on.
<o:p> </o:p>
I hope this makes sense and would dearly appreciate any help or advice. I am also happy to upload the spreadsheet I have so far somewhere if my description is unclear.
<o:p> </o:p>
David.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Code:
Sub test()
'
' test Macro
' Macro recorded 27/09/2010 by sclarke2
'
'
    ActiveCell.Offset(-41, 1).Range("A1:AE2").Select
    Selection.Cut
    ActiveCell.Offset(0, 1).Range("A1").Select
    ActiveSheet.Paste
    ActiveCell.Offset(0, -2).Range("A1:D2").Select
    Selection.Interior.ColorIndex = 2
    ActiveCell.Offset(0, 4).Columns("A:A").EntireColumn.Select
    Selection.EntireColumn.Hidden = True
    ActiveCell.Offset(0, 30).Columns("A:A").EntireColumn.Select
    Selection.Insert Shift:=xlToRight
    ActiveCell.Offset(4, -26).Range("A1:A50").Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    ActiveCell.Offset(0, 1).Range("A1:A50").Select
    ActiveCell.Offset(49, 1).Range("A1").Activate
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    ActiveCell.Offset(-31, 9).Range("A1").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,306
Messages
6,129,990
Members
449,550
Latest member
LML2892

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top