Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Copy a range with application.inputbox

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy a range with application.inputbox

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Copy a range with application.inputbox

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Copy a range with application.inputbox

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.InputBox Steven Excel Programming 2 December 23rd 06 11:56 PM
application.inputbox Christmas May[_2_] Excel Programming 5 November 22nd 06 04:11 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
inputbox and application.run macro1 Michael Joe Excel Programming 3 August 13th 04 09:34 PM
application.inputbox Murat Excel Programming 4 February 24th 04 11:38 AM


All times are GMT +1. The time now is 01:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"