unlock row header

gto70ski

New Member
Joined
Mar 27, 2019
Messages
4
I already have column header row (that is ediable) in a particular spreadsheet.

But when I import data from Access into to the spreadsheet, say starting at row three, I get the access table header row that is uneditable and unremovable.

Right click on the access table header row gives a greyed out delete option.

Suggestions?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Not sure how comfortable you are with macros, but it's a pretty easy way to solve your dilemma.

**Change blue text items to match your scenario.**
Code:
Sub OpenTable()
Dim rs As Object, cn$, ssql$
Set rs = CreateObject("ADODB.Recordset")
cn = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source=" & _
    "[B][COLOR=#0000cd]C:\database.accdb[/COLOR][/B];"
ssql = "SELECT * FROM [B][COLOR=#0000cd]Table[/COLOR][/B]"
rs.Open ssql, cn, 0, 3
[A3].CopyFromRecordset rs
Call MakeTable([A3].CurrentRegion, "Table1")
End Sub


Sub MakeTable(ByRef rng As Range, ByVal tbl As String)
With ActiveSheet
    .ListObjects.Add(xlSrcRange, Range(rng.Address), , xlYes).Name = tbl
    .ListObjects(tbl).TableStyle = "TableStyleMedium15"
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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