Using VB to populate cals using Cell Names

gemcka

New Member
Joined
Jan 17, 2014
Messages
2
Hi, We use SharePoint as a document management system and I would like to make a spread sheet template that will take data out of SharePoint and enter it into cells in the xlsx document. We use this at the moment


Sub SynchServerProperties()
Dim metaprop As MetaProperty
On Error Resume Next
ActiveSheet.Protect UserInterfaceOnly:=True
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False, _
AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowInsertingColumns:=True, AllowInsertingRows:=True, AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=True, AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
For Each metaprop In ActiveWorkbook.ContentTypeProperties
If metaprop.Name = "Document Type" Then
Cells(Document_Type).Value = metaprop.Value
End If
If metaprop.Name = "Reference" Then
Cells(1, 18).Value = metaprop.Value
End If
If metaprop.Name = "Revision" Then
Cells(2, 18).Value = metaprop.Value
End If
If metaprop.Name = "Date of Application" Then
Cells(3, 18).Value = metaprop.Value
End If.....................


This enters the data into specific cells, eg, it puts the reference number into row 1, column 18
but this can change if anyone adds extra columns into the sheet.

Is there a way for the data to be entered into a Cell Name?

Many thanks for any help

Gavin.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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