pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi
Below is my current code.
What it does is copy the selection offset, loop and paste in next empty row.....with selection it gives lines...etc...
I want the macro to give 1 gap (blank row) before pasting....
and i want the top row on the table to be in blue colour.
Please edit the code for me.
Thanks alot for helping!
Below is my current code.
What it does is copy the selection offset, loop and paste in next empty row.....with selection it gives lines...etc...
I want the macro to give 1 gap (blank row) before pasting....
and i want the top row on the table to be in blue colour.
Please edit the code for me.
Thanks alot for helping!
Code:
Sub Macro1()
Sheets("yahoo").Select
'unprotect timer
ActiveSheet.unprotect Password = "123"
Range("B2").Select
Selection.CurrentRegion.Select
Selection.Copy
Range("B11").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
'fomat here
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Macro10
' clear prev information
Range("C3:C6").Select
Selection.ClearContents
Range("E3:E6").Select
Selection.ClearContents
Range("G3:H7").Select
Columns("B:I").EntireColumn.AutoFit
Application.CutCopyMode = False
Cells(1).Select
End Sub
Sub Macro10()
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
Range("B11").Select
ActiveSheet.unprotect Password = "123"
End Sub