Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Populate one sheet based on vlaues in another sheet

Posted on 2011-03-02
7
Medium Priority
?
204 Views
Last Modified: 2012-05-11
This has been asked before, but I couldn't find the exact answer I was looking for..
In the sheet 'Template Requirements' there are some cell with 'n/a' in them. I simply want to populate the sheet 'Data' with JUST the 'N/A' values and make the 'N/A' cells prohibited from changing (i.e. entering data).
dashboard-wipv3a.xlsm
0
Comment
Question by:singleton2787
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:Eric Zwiekhorst
ID: 35018084
Hi Singleton,

I do not understand what you mean with:

I simply want to populate the sheet 'Data' with JUST the 'N/A' values and make the 'N/A' cells prohibited from changing (i.e. entering data).
   
Do you want the possibility to enter data in the N/A filled field just one time, and after that they should be locked?

this is feasable...

Kind reagrds

Eric
0
 
LVL 6

Expert Comment

by:Eric Zwiekhorst
ID: 35018126
Try lock the sheet and leaving unlocked the N/A values.

then put in the sheet macro
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
 Dim myString As String
 Dim cel As Range, TARG As Range
 Dim KOLOM As Integer
Application.EnableEvents = False
On Error Resume Next
Set TARG = Intersect(Target, Range("3:10"))     'Obviously you can change this target range to your desired range
KOLOM = TARG.Column
 If TARG Is Nothing Then
   Application.EnableEvents = True
   Exit Sub
   Else
   myString = TARG
End If
If TARG.Locked = False Then TARG.Locked = True
End Sub


kind regards

Eric
0
 
LVL 9

Expert Comment

by:McOz
ID: 35018133
You could use formulas to populate the N/A values in the Data sheet, then run some code like this in the WorkSheet_Activate event or similar:
Private Sub Worksheet_Activate()
    ActiveSheet.Unprotect
    For Each c In ActiveSheet.UsedRange.Cells
        If c.Value = "N/A" Then c.Locked = True Else c.Locked = False
    Next
    ActiveSheet.Protect
End Sub

Open in new window


Good luck!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:singleton2787
ID: 35019439
Zwie, I get an unexpected End Sub on the macro...
0
 

Author Comment

by:singleton2787
ID: 35019449
McOZ, how do I activate this code??
0
 
LVL 9

Accepted Solution

by:
McOz earned 2000 total points
ID: 35019513
1. Right click on the "Data" sheet tab at the bottom, and choose "View Code"
2. Copy and paste the code into the window, and save.
3. whenever you go to the Data sheet, it will automatically run this code, which locks all cells containing the value "N/A"

Cheers!
0
 

Author Closing Comment

by:singleton2787
ID: 35037646
Bravo!!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question