ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   New value in a cell (https://www.excelbanter.com/excel-programming/352915-new-value-cell.html)

alvin Kuiper

New value in a cell
 
Hi
I'm using this to write a new value in a empty cell
With Worksheets("Ark1")
Set cell = .Cells(Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal

this code insert a new postin collum A

Now my problem is that i have 2 values i want to ahve in collum
A and B How do i do that?

regards

Alvin




Gary Keramidas

New value in a cell
 
if i understand, you wnt something in the cell next to it?

cell.offset(0,1).value = "your 2nd value"

--


Gary


"alvin Kuiper" wrote in message
...
Hi
I'm using this to write a new value in a empty cell
With Worksheets("Ark1")
Set cell = .Cells(Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal

this code insert a new postin collum A

Now my problem is that i have 2 values i want to ahve in collum
A and B How do i do that?

regards

Alvin






sebastienm

New value in a cell
 
Hi

- first , you may want to put a dot '.' in front of the property Rows.Count.
- now to get the cell to the right of the variable cell, you can use :
cell.Offset(0,1)

With Worksheets("Ark1")
Set cell = .Cells(.Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal
cell.Offset(0,1).Value = ...
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"alvin Kuiper" wrote:

Hi
I'm using this to write a new value in a empty cell
With Worksheets("Ark1")
Set cell = .Cells(Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal

this code insert a new postin collum A

Now my problem is that i have 2 values i want to ahve in collum
A and B How do i do that?

regards

Alvin



alvin Kuiper

New value in a cell
 
thanks its working

best regards
ALivn


"sebastienm" wrote:

Hi

- first , you may want to put a dot '.' in front of the property Rows.Count.
- now to get the cell to the right of the variable cell, you can use :
cell.Offset(0,1)

With Worksheets("Ark1")
Set cell = .Cells(.Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal
cell.Offset(0,1).Value = ...
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"alvin Kuiper" wrote:

Hi
I'm using this to write a new value in a empty cell
With Worksheets("Ark1")
Set cell = .Cells(Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal

this code insert a new postin collum A

Now my problem is that i have 2 values i want to ahve in collum
A and B How do i do that?

regards

Alvin



alvin Kuiper

New value in a cell
 
Yes thank you

Alvin

"Gary Keramidas" wrote:

if i understand, you wnt something in the cell next to it?

cell.offset(0,1).value = "your 2nd value"

--


Gary


"alvin Kuiper" wrote in message
...
Hi
I'm using this to write a new value in a empty cell
With Worksheets("Ark1")
Set cell = .Cells(Rows.Count, 1).End(xlUp)
End With
If Not IsEmpty(cell) Then Set cell = cell(2)
cell.Value = antal

this code insert a new postin collum A

Now my problem is that i have 2 values i want to ahve in collum
A and B How do i do that?

regards

Alvin








All times are GMT +1. The time now is 02:17 AM.

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