Issues with an input macro and a protected table on another sheet

Lyryx

New Member
Joined
Aug 18, 2015
Messages
45
I'm nearly finished a workbook and I'm having issues with the macro.

The workbook's main function is to allow our general staff to enter information into an input sheet and then have that information populate our worklog table. The table and the workbook are protected outside of a few cells that the staff can use to fill in their information. There is no password on these locks and no need to worry about any password showing up in the VBA code if I choose to add one.

The information from the "Input" worksheet is brought into "Table1" on a different worksheet labeled "Table".

My current Macro works but only when the table worksheet isn't protected. Which poses a large issue because this information is not allowed to be altered.


It looks like this.

Code:
Sub Population()
'
' Population Macro
' Populates worklog input information into table1 on the table tab.


    Sheet1.Unprotect
    Range("B3:B11").Select
    Selection.Copy
    Sheets("Table").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=True
    Rows("2:2").Select
    Application.CutCopyMode = False
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A2").Select
    Sheets("Input Worksheet").Select
    Selection.ClearContents
    Range("B3").Select
    Sheet1.Protect
End Sub
It unprotects the input sheet
selects the information
populates the table with the information and then adds a new line
returns to the input worksheet
clears the information
then protects it again.


I've tried getting it to unprotect the table worksheet but it just halts everything. So I removed that line of code while I finish the rest of the workbook. I'm really struggling with this one.

Thanks in advance.


The table is labeled "Table1"
and is located on a tab labeled "Table"
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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