473,385 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Writing vba ouput into excel file

1
hi, I am running a for loop 100 times. each loop giving an output.
and I wish to print all those outputs into an excel file. I tried using
Expand|Select|Wrap|Line Numbers
  1. Worksheet("sheet1").Range(A1:A101) = VBA.abs(value)
But the trouble is that it prints the same value a 100 times for every loop, with every loop output over writing the previous one's output.
Meaning the output I can see is of the 100th loop printed in a 100 cells(A1:A101). Where as I want all the 100 (different) loop outputs to be printed.

Any help would be greatly appreciated.
Thanks
Feb 5 '12 #1
1 1278
NeoPa
32,556 Expert Mod 16PB
It would make more sense to include the code for the loop in the question, but I will have to assume you have variables available that reflect the iteration through the loop (I'll use intX.) and the value to be assigned (I'll use intVal as value would not be a clever choice).

Expand|Select|Wrap|Line Numbers
  1. Worksheet("sheet1").Range("A" & intX) = intVal
Feb 5 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Paul | last post by:
I was wondering if anyone has had an issue where using vba code to read an excel file and import the data into an access table some records are not imported from the excel file. It seems looking at...
0
by: I Decker | last post by:
Hi all, Hope this is the right group. I am writing a program in c# to open create an excel document, enter some data, save it and then email it as an attachment. I have successfully created...
3
by: RJN | last post by:
Hi I've a template excel file which has all the calculations defined. There are certain input values to be entered which gives a lot of output to the user. I don't want to expose the excel sheet...
27
by: jeniffer | last post by:
I need to create an excel file through a C program and then to populate it.How can it be done?
2
by: arvind1083 | last post by:
I need help for writing a excel file. As in one excel file there could be more than one sheets so I want to know how can I give name to different sheets and select a particular sheet for writing or...
1
by: santoshshrigadwar | last post by:
Can someone can help me how to write to Excell File, create Shets and format cell using vb.net
4
by: preetinair033 | last post by:
Hi All, I have written a program to write the data into excel file (for eg: file.xls). This writes the data into the active sheet, ie, the sheet1. However I wish to write and read data from an...
3
by: thanawala27 | last post by:
Hi, I had problems writing in an existing Excel File. There is an excel file with a worksheet. I would like to open this existing Excel file and add another worksheet and write data into it....
1
by: =?Utf-8?B?ZmhpbGxpcG8=?= | last post by:
We have a code snippet that downloads data to Excel. it is writing row by row. This causes a performance issue. Any ideas on how to speed this up will be appreciated. Please find below an...
15
by: patf | last post by:
Hi - experienced programmer but this is my first Python program. This URL will retrieve an excel spreadsheet containing (that day's) msci stock index returns. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.