VBA help for filling down and adding borders, please

-Paul-

New Member
Joined
Nov 18, 2011
Messages
25
Hi all

I have a Workbook with month tabs. On each tab I am using the same range of columns - A:X with the rows growing down as the month goes on. The rows grow differently every day. Some days there could be 1 new record, other days 100.
What I'm trying to achieve is a VBA that will put a border around all cells for the new records once I have filled in the information.

Also I need the VBA to fill down the new rows with the current date in column A. Along with filling down the formulas that are in columns V, W & X.

The end result will be all those columns down filled and a full cells border added to the new records per day with the click of one button.

My VBA skills leave a lot to be desired, so I'm reaching out to you guys for help. Is what I'm looking for even possible?


Thank you in advance
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Have you considered using an Excel Table
- it does almost everything you seem to want
- format the table as required. New lines are formatted and formulas inserted automatically
- see https://www.excelefficiency.com/excel-table-benefits/

VBA would be required to insert the current date into column A.
- goes in sheet module
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Column = 1 Then
        If Target > 0 Then
            If Not MsgBox("Amend to current date?", vbYesNo) = vbYes Then Exit Sub
        End If
        Target = Date
    End If
End Sub
 
Upvote 0
I've read through the info and it's not helped me much.
I've since learnt about ranges in VBA and have reached this far

Code:
Sub Fill_It_Down()Range("V2:X2").AutoFill Destination:=Range("V2:X" & Range("B" & Rows.Count).End(xlUp).Row)
End Sub


I can't work out how to get column A into this.
Also I need it to find the last row with data in each of these columns as columns A & V are one row lower than the rest of the range.
 
Upvote 0
I have learnt a bit more code, but have hit another wall.
I want to be able to select the last cells with data in columns A,D:F all at the same time, but the code is only selecting the last cell in column A.
This is the first step in the code. The next step is to be able to fill down those columns at the same time to row 9.
My VBA skills are clearly not very advanced. I've searched online for solutions to no avail, so far.
Can anyone point me in the right direction on where my code is going wrong please?

Code:
Sub LastCellInColumnsADEF()
Range("A:A,D:D,E:E,F:F").End(xlDown).Select
End Sub


ABCDEF
1111111
2111111
3111111
4111111
51111
611
711
811
911

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,669
Members
448,977
Latest member
moonlight6

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