Edit Records

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,132
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Hi,

I have a set of records from a4:J3993.
Is there a way or code as the user cannot change or add any of the records.

But I don't want the to protect and un-protect the excel sheet.

Thanks.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Put them on a sheet and then hide (or very hide) the sheet.
Use formulas to refer to those cells. If you want the user to see the records use formulas like =HiddenSheet!A4 and then drag to duplicate the records on another sheet.
 
Upvote 0
Well I have set of codes running as
in UserForm1 I have combox1

Code
Private Sub UserForm_Initialize()
Range("C5", Range("C" & Rows.Count).End(xlUp)).Name = "NodeName"
Me.ComboBox1.RowSource = "NodeName"
CommandButton2.Visible = False
Label2.Visible = False
TextBox1.Visible = False
End Sub

and in userform1 I have other code, were it will email the data.

If I do it veryhidden then there is problem.

So just need a code were it will not protect then sheet, but will not allow the user to edit or enter the data.

I have this code below but its not working.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect(Range("A4:J3993), Target) Is Nothing Then
Application.EnableEvents = False
Application.EnableEvents = True
End If
End Sub
 
Upvote 0
I would change that code to reference the sheet, so you aren't required to have the data sheet active, and to eliminate the use of .RowSource
Code:
Private Sub UserForm_Initialize()
     With ThisWorkbook.Sheets("HiddenSheet").Range("C5", Range("C" & Rows.Count).End(xlUp))
         Me.ComboBox1.List = Application.Transpose(.Value)
    End With
    CommandButton2.Visible = False
    Label2.Visible = False
    TextBox1.Visible = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

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