ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   use the range value from a cell to update the cell with data (https://www.excelbanter.com/excel-programming/402134-use-range-value-cell-update-cell-data.html)

wvan

use the range value from a cell to update the cell with data
 
I have 3 values. Value one refers to the row number, value 2 referes to the
column number and value 3 is the data I want to put in the cell. I would
like a button to use value 1 and 2 to locate the cell and put value 3 into it.

I can calculate the exact cell using Address function as follows but don't
know the code to update the value in the cell.

Thanks.


Gary''s Student

use the range value from a cell to update the cell with data
 
Sub place_it()
value01 = 20
value02 = 13
value03 = 123.456
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759


"wvan" wrote:

I have 3 values. Value one refers to the row number, value 2 referes to the
column number and value 3 is the data I want to put in the cell. I would
like a button to use value 1 and 2 to locate the cell and put value 3 into it.

I can calculate the exact cell using Address function as follows but don't
know the code to update the value in the cell.

Thanks.


wvan

use the range value from a cell to update the cell with data
 
Thank you. How do I get the value for instance from a4 to replace the
current value 20 you assigned?


"Gary''s Student" wrote:

Sub place_it()
value01 = 20
value02 = 13
value03 = 123.456
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759


"wvan" wrote:

I have 3 values. Value one refers to the row number, value 2 referes to the
column number and value 3 is the data I want to put in the cell. I would
like a button to use value 1 and 2 to locate the cell and put value 3 into it.

I can calculate the exact cell using Address function as follows but don't
know the code to update the value in the cell.

Thanks.


wvan

use the range value from a cell to update the cell with data
 
Thank you. How do I get the value, for instance from cell a4 to replace the
current value 20 you assigned?

"Gary''s Student" wrote:

Sub place_it()
value01 = 20
value02 = 13
value03 = 123.456
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759


"wvan" wrote:

I have 3 values. Value one refers to the row number, value 2 referes to the
column number and value 3 is the data I want to put in the cell. I would
like a button to use value 1 and 2 to locate the cell and put value 3 into it.

I can calculate the exact cell using Address function as follows but don't
know the code to update the value in the cell.

Thanks.


Gary''s Student

use the range value from a cell to update the cell with data
 
Sub place_it()
value01 = Range("A1").Value
value02 = Range("A2").Value
value03 = Range("A3").Value
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759

wvan

use the range value from a cell to update the cell with data
 
Hi again,

A4 = $H$14 (used =ADDRESS(MATCH(B1,A1:A32,1),MATCH(B2,A5:EF5,1))) to
calculate A4
B3 = P1

value01 = Range("A4").Value
value03 = Range("B3").Value
Cells(value01).Value = value03

I get the error "Type Mismatch", can you help me again with this?

Thanks so much.

"Gary''s Student" wrote:

Sub place_it()
value01 = Range("A1").Value
value02 = Range("A2").Value
value03 = Range("A3").Value
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759


Gary''s Student

use the range value from a cell to update the cell with data
 
Cells() needs two arguments, Range() only needs one.
--
Gary''s Student - gsnu200759


"wvan" wrote:

Hi again,

A4 = $H$14 (used =ADDRESS(MATCH(B1,A1:A32,1),MATCH(B2,A5:EF5,1))) to
calculate A4
B3 = P1

value01 = Range("A4").Value
value03 = Range("B3").Value
Cells(value01).Value = value03

I get the error "Type Mismatch", can you help me again with this?

Thanks so much.

"Gary''s Student" wrote:

Sub place_it()
value01 = Range("A1").Value
value02 = Range("A2").Value
value03 = Range("A3").Value
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759


wvan

use the range value from a cell to update the cell with data
 
Just perfect, thanks so much.

"Gary''s Student" wrote:

Cells() needs two arguments, Range() only needs one.
--
Gary''s Student - gsnu200759


"wvan" wrote:

Hi again,

A4 = $H$14 (used =ADDRESS(MATCH(B1,A1:A32,1),MATCH(B2,A5:EF5,1))) to
calculate A4
B3 = P1

value01 = Range("A4").Value
value03 = Range("B3").Value
Cells(value01).Value = value03

I get the error "Type Mismatch", can you help me again with this?

Thanks so much.

"Gary''s Student" wrote:

Sub place_it()
value01 = Range("A1").Value
value02 = Range("A2").Value
value03 = Range("A3").Value
Cells(value01, value02).Value = value03
End Sub

--
Gary''s Student - gsnu200759



All times are GMT +1. The time now is 01:38 AM.

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