Jump to content
sree161

How to Copy output to specific cells in excel?

Recommended Posts

sree161

Hi,

i have a code which generates two numeric outputs.i have to save them in excel.
Is there any way to export them to specific cells in excel???

Share this post


Link to post
Share on other sites
KickStarter15

@sree161, Yes, you can use _Excel_RangeWrite() for that.


Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
sree161

But it doen't tell how to paste it in specific cell??
any special command to do that??

Share this post


Link to post
Share on other sites
JoHanatCent

 _Excel_RangeWrite()

With parameter $vRange you specify for example cell "c3"

 

 


Share this post


Link to post
Share on other sites
KickStarter15

@sree161, try checking with help file and see all the parameters you need for writing in excel.


Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
sree161

Hi all, 

Thanks for the suggestions. I have learnt to use all those parameters.

I am struck with a problem.

I am running a loop, which gives 2 values at the end and have to copy this to excel.

Each time the loop gives a output I am able to paste in A2 , B2 as I set those 

How can I automatically jump to next line i.e A3 ,B3 for next loop output???

Any logics plzz??

Thanks in advance,

Sree161

 

Share this post


Link to post
Share on other sites
water

Use a counter (e.g. $i) that starts with 0 and is incremented each time before you write new values.
Set the target cell to write to like this:

"A" & $i

 

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
sree161
2 hours ago, water said:

Use a counter (e.g. $i) that starts with 0 and is incremented each time before you write new values.
Set the target cell to write to like this:

"A" & $i

 

This worked. Thanks a lot

Share this post


Link to post
Share on other sites
water

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • santoshM
      By santoshM
      How can i exit from a procedure in auto
      Func test() if x=o then     return endif endFunc  
    • Valnurat
      By Valnurat
      Hi
      Small question.
      I trying to find all index in an array with value higher than 7.
      How can that be possible?
    • TrashBoat
      By TrashBoat
      Could someone help me create or give an idea of how to do a incrementing for loop that would do this: https://i.imgur.com/YFUt47H.gifv
      I'm having a hard time figuring it out :S
    • msd1994
      By msd1994
      I have a script that just adds some keyboard shortcuts for things like displaying the current song and artist, moving the window to the side so it won't pop up in my way, and play/pause, next song, previous song (these are the only 3 to still work since they don't need the window handle.)
      In some update recently, Spotify's window class swapped from "[CLASS:SpotifyMainWindow]" to "[CLASS:Chrome_WidgetWin_0]". Using the new class in my controls doesn't seem to work, I've tried getting the window handle from the process handle (_GetHwndFromPID($PID)) but that seems to fail as well.
      Does anybody have some idea of a way I could get this script working again?
       
      edit: seems like discord has the same window class name, so could be some issue with this? Still not sure of a way to solve the issue though, I added a function to get the handle of the active window and can just use that now, but it was able to find it on its own before on spotify startup or script startup which would be preferred.
       
      Thanks!
    • sumandevadiga
      By sumandevadiga
      Hello 
      I would like to Run Outlook macros from Autoit every 1 hour, below script unable to run macros.
      While 1 $Minute = Random(1,59,1) Do Sleep(1000) Until @Min = $Minute ; do whatever ; Since we want it to run randomly once an hour, we need to calculate how much time is left before the hour is up, and sleep that length of time. $s = ((60 - $Minute) * 60) * 1000 Sleep($s) $oOApp = ObjCreate("Outlook.Application") $oOApp.Run("SaveAttachments") ; Run Outlook Macros WEnd  
       
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.