ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing a cell without selecting it (https://www.excelbanter.com/excel-programming/348613-changing-cell-without-selecting.html)

[email protected]

Changing a cell without selecting it
 
I'm a developer, but new to Excel coding. One thing that I can't
figure out... is there a way to change a cell without selecting it like
below?

Cells(curRow, 3).Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

I don't want the cursor (cell selection box) jumping all over the
screen while I'm doing things behind the scene.

thanks,

fg


John[_88_]

Changing a cell without selecting it
 
Hi fg,

You're virtually there with just the Cells object:

With Cells(curRow, 3).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

Likewise you can get and set a cell's value by Cell(r, c).Value = ....

Hope that helps.

Best regards

John

wrote in message
ups.com...
I'm a developer, but new to Excel coding. One thing that I can't
figure out... is there a way to change a cell without selecting it like
below?

Cells(curRow, 3).Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

I don't want the cursor (cell selection box) jumping all over the
screen while I'm doing things behind the scene.

thanks,

fg




ilyaskazi[_107_]

Changing a cell without selecting it
 

Hi try this...


Code
-------------------
With Cells(curRow, 3)
.ColorIndex = 36
.Pattern = xlSolid
End Wit
-------------------

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=49515


Toppers

Changing a cell without selecting it
 
Hi,

Cells(curRow, 3).Interior.ColorIndex = 36

HTH

"John" wrote:

Hi fg,

You're virtually there with just the Cells object:

With Cells(curRow, 3).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

Likewise you can get and set a cell's value by Cell(r, c).Value = ....

Hope that helps.

Best regards

John

wrote in message
ups.com...
I'm a developer, but new to Excel coding. One thing that I can't
figure out... is there a way to change a cell without selecting it like
below?

Cells(curRow, 3).Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

I don't want the cursor (cell selection box) jumping all over the
screen while I'm doing things behind the scene.

thanks,

fg






All times are GMT +1. The time now is 10:31 AM.

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