PC Review


Reply
Thread Tools Rate Thread

Copy a range with application.inputbox

 
 
=?Utf-8?B?ZXhjZWxlbnQ=?=
Guest
Posts: n/a
 
      1st Apr 2007
Hi folks

i got this sub that copy a cell or a range from 1 place to another
in the same sheet, but if i fx. copy a cell with the formula =SUM(A1:A3)
then the destinations copy show exatly the same =SUM(A1:A3)
and thats just what i want but here the problem :

How do i change the kode so i can copy from 1 sheet to another ?

Sub xCopy()

Set x = Application.InputBox(prompt:="Select a cell", Type:=8)
Set y = Application.InputBox(prompt:="Select a cell", Type:=8)

Range(y.Address) = x.Formula

End Sub

thanks in advance for any help.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      1st Apr 2007
Sub xCopy()

Set x = Application.InputBox(prompt:="Select a cell", Type:=8)
Set y = Application.InputBox(prompt:="Select a cell", Type:=8)

y.copy _
destination:=x

End Sub

(With no validity checks)


excelent wrote:
>
> Hi folks
>
> i got this sub that copy a cell or a range from 1 place to another
> in the same sheet, but if i fx. copy a cell with the formula =SUM(A1:A3)
> then the destinations copy show exatly the same =SUM(A1:A3)
> and thats just what i want but here the problem :
>
> How do i change the kode so i can copy from 1 sheet to another ?
>
> Sub xCopy()
>
> Set x = Application.InputBox(prompt:="Select a cell", Type:=8)
> Set y = Application.InputBox(prompt:="Select a cell", Type:=8)
>
> Range(y.Address) = x.Formula
>
> End Sub
>
> thanks in advance for any help.


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      1st Apr 2007
Sub xCopy()

Set x = Application.InputBox(prompt:="Select a cell", Type:=8)
Set y = Application.InputBox(prompt:="Select a cell", Type:=8)

y.Formula = x.Formula

End Sub

answer the inputboxes via mouse clicks.


Your method
Range(y.address)
hides the parent, so excel does not know which sheet you are referring to
--
Gary''s Student - gsnu200713

 
Reply With Quote
 
=?Utf-8?B?ZXhjZWxlbnQ=?=
Guest
Posts: n/a
 
      2nd Apr 2007
thanks both for reply

Gary had what i need


"Gary''s Student" skrev:

> Sub xCopy()
>
> Set x = Application.InputBox(prompt:="Select a cell", Type:=8)
> Set y = Application.InputBox(prompt:="Select a cell", Type:=8)
>
> y.Formula = x.Formula
>
> End Sub
>
> answer the inputboxes via mouse clicks.
>
>
> Your method
> Range(y.address)
> hides the parent, so excel does not know which sheet you are referring to
> --
> Gary''s Student - gsnu200713
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning a range from application.inputbox ker_01 Microsoft Excel Programming 5 14th Jul 2009 07:00 PM
Application.InputBox (Range) Rafi Microsoft Excel Programming 2 10th Feb 2009 06:22 PM
Application inputbox, Range versus Cancel =?Utf-8?B?TmVhbCBaaW1t?= Microsoft Excel Programming 8 25th Sep 2007 05:52 PM
Range through Inputbox jasmine Microsoft Excel Programming 3 5th Mar 2007 12:13 AM
Inputbox and Application.InputBox Maria Microsoft Excel Programming 1 20th Sep 2004 11:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:18 AM.