Solved

Populate one sheet based on vlaues in another sheet

Posted on 2011-03-02
7
202 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
Independent Software Vendors: 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 500 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
excel file icon - over last few months weird 2 27
Excel Add-in Subscript out of range 5 32
copy down array 24 36
need count any combinaton of 4 numbers 7 27
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

710 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