It refuses to draw the borders on the Worksheet that I am attempting to direct it to... it just keeps drawing the border on my main worksheet(?)
I've tried putting the "ActiveWorkbook.Worksheets" part of the code in various places, but I dont think it should even matter if its in there or not since I had already set 'ws' as the Worksheet I have in my range (but I was desperate and trying everything lol).
I also tried this code, but it just gives me an error: (Method of 'Range' of object '_Worksheet' failed)
Help! Please and Thank you.
Code:
Private Sub cmdCopyNames_Click()
Dim kCol As Long
kCol = Sheets("Sheet13").UsedRange.Rows.Count + 1
Dim ws As Worksheet
Set ws = Worksheets("Sheet13")
ActiveWorkbook.Worksheets("Sheet13").Activate
With ws
Range(Cells(2, 2), Cells(kCol, 2)).Borders.LineStyle = xlContinuous
Range(Cells(2, 2), Cells(kCol, 2)).Borders.Weight = xlThin
Range(Cells(2, 2), Cells(kCol, 2)).Borders.Color = 8210719
End With
End Sub
I've tried putting the "ActiveWorkbook.Worksheets" part of the code in various places, but I dont think it should even matter if its in there or not since I had already set 'ws' as the Worksheet I have in my range (but I was desperate and trying everything lol).
I also tried this code, but it just gives me an error: (Method of 'Range' of object '_Worksheet' failed)
Code:
Range(Worksheets("Sheet13").Cells(2, 2), Worksheets("Sheet13").Cells(kCol, 2)).Borders.LineStyle = xlContinuous
Help! Please and Thank you.