ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   assign values to specific cells in an excel sheet through text file (https://www.excelbanter.com/excel-discussion-misc-queries/187022-assign-values-specific-cells-excel-sheet-through-text-file.html)

s_pushparaj

assign values to specific cells in an excel sheet through text file
 

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

Gary''s Student

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


s_pushparaj[_2_]

assign values to specific cells in an excel sheet through text file
 

Thank you Gary's Student, your code works.
with thanks
s_pushparaj

s_pushparaj;2764965 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


All times are GMT +1. The time now is 02:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com