View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default assign values to specific cells in an excel sheet through text fil

Here is an example:

Sub Macro1()
ChDir "C:\"
Workbooks.Open Filename:="C:\data.xls"
Range("A1").Value = 1
Range("B1").Value = 2
Range("C1").Value = 3
Range("D1").Value = 4
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
--
Gary''s Student - gsnu2007h


"s_pushparaj" wrote:


Hi list
I am very new to macros or any visual basic codes. Kindly guide me with
materials or ideas to assign values to specific cells in an excel sheet.
For example,
I wish to assign values 1,2,3,4.... into A1, B1, C1, D1...... in Sheet1
of C:\data.xls.
with thanks
pushparaj




--
s_pushparaj