Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Reza, Since both workbooks are open, the easiest way is to use the Windows collection to get to w2.xls. The following code snippet (in a standard module in w1.xls) activates w2.xls, prompts the user to select a range of cells, then places those cell values into w1.xls starting at A1... Public Sub ChosenCells() Dim rngWhatCells As Range Windows("w2.xls").Activate On Error GoTo CANCELLED Set rngWhatCells = Application.InputBox( _ Prompt:="Select Cells for processing.", _ Title:="What Cells?", _ Default:=Selection.Address, _ Type:=8) Windows("w1.xls").Activate Range(Cells(1, 1), Cells(rngWhatCells.Rows.Count, _ rngWhatCells.Columns.Count)).Value = rngWhatCells.Value CANCELLED: Windows("w1.xls").Activate End Sub Ken |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why does my textbox not print the same as it is seen onscreen? | Excel Discussion (Misc queries) | |||
How can I format cells to be visible onscreen but not print out? | Excel Discussion (Misc queries) | |||
Cell fill color doesn't show onscreen | Excel Discussion (Misc queries) | |||
How do I view color onscreen (it shows up in print view only) | Excel Discussion (Misc queries) | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming |