Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 52
Default visual basic pasting formulae

writing a macro which pastes a formula into a cell (r,c)
to equal the value of a cell in another sheet (rr,cc)
then r=r+1, rr=rr+1 and repeat this in a loop count =1,
until count =4 then r=r+1 (still) but rr=rr+4 and count
is reset to count =1

the count bit is no problem but i cant get it to paste
the formula, i believe the vba code to paste the formula
is: ActiveCell.Formula = "=Sheet4!(rr+2,cc+1)"

Please help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default visual basic pasting formulae


I didn't exatly follow your logic but to paste a cell I use


activecell.value=sheets("Sheet 4").cells(rr+2,cc+1)

This assumes the data is in a common workbook otherwise ...

activecell.value=workbooks("book2.xls").sheets("Sh ee
4").cells(rr+2,cc+1)

Hope this help

--
jmoffa
-----------------------------------------------------------------------
jmoffat's Profile: http://www.excelforum.com/member.php...nfo&userid=115
View this thread: http://www.excelforum.com/showthread.php?threadid=27011

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
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Dynamically pasting function from Visual Basic to Excel cell John Fejsa Excel Programming 0 February 9th 04 11:45 PM


All times are GMT +1. The time now is 09:13 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"