Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bastet Massri   on Jan 18 In MS Office Category.

  
Question Answered By: Kawkab Mansour   on Jan 18

If I understand correctly, it shouldn't be difficult.
Now, there's probably better ways of doing this, but given the criteria
you specified... here's what I "heard":
1) Sheet1 has named  ranges (What the range CONTAINS is irrelevant)
2) you want to enter the Range name into cell A1 and have the contents
of the range from Sheet1 copied  to cells A2 through ...

Simple enough.
Right click on the tab name for Sheet2, and select  View Code.
On this sheet, create a change  Event:
'---------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If (Target.Address = "$A$1") Then
Application.EnableEvents = False
Sheets("Sheet2").Range("A2:A20").ClearContents
blkname = Target.Value
Sheets("Sheet1").Range(blkname).Copy
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Application.EnableEvents = True
End If
End Sub
-----------------------------------
This event looks to see if you changed the contents of A1, then
disables future change events (so it doesn't have to keep executing
this macro  when you're pasting into the sheet!),
then clears the contents and copies the named range to this sheet.

Look like what you want?

I used the PasteSpecial so that you can change the display
on Sheet2 to anything you want, and the whole list can remain simple.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on need your help Or get search suggestion and latest updates.


Tagged: