Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to paste variable value onto a Cell?

Through a code, I have got a variable some value. How do I paste it to a
Cell ? Like,

For Each c In Worksheets("Sheet1").Range("A2:A5").Cells
valie = c.Value
If c.Value = 22381 Then
wala = c.Offset(0, 5).Value
If wala = "pills" Then
milla = c.Offset(0, 2).Value

counter = 0
ChDir "C:\milinda"
Workbooks.Open FileName:="C:\milinda\sample-1.xls"
Range("E" & counter + 1).Select
ActiveSheet.Paste = milla

I need to paste the value of milla in the said cell. What is the command ?

Milind


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default How to paste variable value onto a Cell?

Milind,

You don't paste a variable, you just assign it, like so

Range("E" & counter + 1).Value = milla


--

HTH

Bob Phillips

"Milind" wrote in message
...
Through a code, I have got a variable some value. How do I paste it to a
Cell ? Like,

For Each c In Worksheets("Sheet1").Range("A2:A5").Cells
valie = c.Value
If c.Value = 22381 Then
wala = c.Offset(0, 5).Value
If wala = "pills" Then
milla = c.Offset(0, 2).Value

counter = 0
ChDir "C:\milinda"
Workbooks.Open FileName:="C:\milinda\sample-1.xls"
Range("E" & counter + 1).Select
ActiveSheet.Paste = milla

I need to paste the value of milla in the said cell. What is the command ?

Milind


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/2003




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
How to copy&paste a variable range rows and colums IK Excel Discussion (Misc queries) 1 August 30th 06 12:06 AM
Adding the same cell in different worksheets. Can that cell be variable? ro Excel Worksheet Functions 0 August 18th 05 06:31 AM
Linking a cell to another workbook cell based on a variable name Brian Excel Discussion (Misc queries) 6 June 1st 05 11:54 PM
Paste Link enters a 0 into the cell where I paste. How do I elemin UNR Excel Discussion (Misc queries) 4 March 28th 05 01:54 AM
how do i use the function to copy and paste a determined variable. Strem Excel Worksheet Functions 2 January 8th 05 05:31 PM


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