G
Guest
Guest
Hello, this is for the same project as the "This Workbook" Macro problem from earlier. THIS problem involves the code near the bottom - Selection Columns A:A. What I am trying to get it to do is when the row is pasted, I want it to past the left border of Column A. It worked yesterday, and today it doesn't work! What I also cannot for the life of me work out is how do I paste the BOTTOM border of Column A as well. In actual fact what I want is only the LAST bottom border, so the square border around the doc is intact, instad of it going all the way around and then the bottom of column A is missing it's bottom border.
This code is probably a God-forsaken mess. I have no idea what I'm doing but it is slowly getting there. In case it matters, Column A has a coloured fill which remains when it's pasted
Here's the code:
Dim shtOriginal As String
Application.ScreenUpdating = False
shtOriginal = ActiveSheet.Name
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("My Class").Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
With Selection.Font
.Name = "Arial"
.Size = 9
.ColorIndex = 0
End With
Selection.Columns("D:AF").Select
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
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(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Columns("A:A").Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
ActiveCell.Offset(0, -3).Range("A1").Select
Sheets(shtOriginal).Select
ActiveCell.Offset(1, 1).Activate
Application.ScreenUpdating = True
End Sub
Thank you to everyone who has helped in anyway to get it this far. YOu are all bloody fantastic!!!
Cheers!
This code is probably a God-forsaken mess. I have no idea what I'm doing but it is slowly getting there. In case it matters, Column A has a coloured fill which remains when it's pasted
Here's the code:
Dim shtOriginal As String
Application.ScreenUpdating = False
shtOriginal = ActiveSheet.Name
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("My Class").Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
With Selection.Font
.Name = "Arial"
.Size = 9
.ColorIndex = 0
End With
Selection.Columns("D:AF").Select
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
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(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Columns("A:A").Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
ActiveCell.Offset(0, -3).Range("A1").Select
Sheets(shtOriginal).Select
ActiveCell.Offset(1, 1).Activate
Application.ScreenUpdating = True
End Sub
Thank you to everyone who has helped in anyway to get it this far. YOu are all bloody fantastic!!!
Cheers!