ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting values from a textbox into a single cell on a spreadsheet (https://www.excelbanter.com/excel-programming/399436-pasting-values-textbox-into-single-cell-spreadsheet.html)

Jordan

Pasting values from a textbox into a single cell on a spreadsheet
 
Hi there,

I am trying to create a macro that searches for a series of identical
entries in a spreadsheet and produces the sum of a corresponding range of
other variables in the spreadsheet (Corresponding to the initial set of
entries). I then want to take this sum value (a Long type variable) and paste
it into a cell on the same spreadsheet. I cannot for the life of me get this
simple paste to work. As of now the macro finds the value so the bulk of my
code works fine, it is just the paste problem that I have. I would greatly
appreciate any help.

Regards,

Jordan

Mike Fogleman

Pasting values from a textbox into a single cell on a spreadsheet
 
Don't try to copy/paste. Just assign the value to the cell.

Dim MyVar As Long

MyVar = some calculations
Cells(3,6).Value = MyVar
' or
Range("F3").Value = MyVar

Mike F
"Jordan" wrote in message
...
Hi there,

I am trying to create a macro that searches for a series of identical
entries in a spreadsheet and produces the sum of a corresponding range of
other variables in the spreadsheet (Corresponding to the initial set of
entries). I then want to take this sum value (a Long type variable) and
paste
it into a cell on the same spreadsheet. I cannot for the life of me get
this
simple paste to work. As of now the macro finds the value so the bulk of
my
code works fine, it is just the paste problem that I have. I would greatly
appreciate any help.

Regards,

Jordan




JLGWhiz

Pasting values from a textbox into a single cell on a spreadsheet
 
you will probably get a more accurate reply if you post the applicable
portion of your code. Just copy and paste right into the posting.

"Jordan" wrote:

Hi there,

I am trying to create a macro that searches for a series of identical
entries in a spreadsheet and produces the sum of a corresponding range of
other variables in the spreadsheet (Corresponding to the initial set of
entries). I then want to take this sum value (a Long type variable) and paste
it into a cell on the same spreadsheet. I cannot for the life of me get this
simple paste to work. As of now the macro finds the value so the bulk of my
code works fine, it is just the paste problem that I have. I would greatly
appreciate any help.

Regards,

Jordan


Jordan

Pasting values from a textbox into a single cell on a spreadsh
 
Thanks Mike that worked. I am fairly new to VB, but have experience with Java
and Python so I am not completely lost. Thanks again for your help.

Jordan




All times are GMT +1. The time now is 05:51 AM.

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