Query on Ranges

sylvest

New Member
Joined
Sep 15, 2006
Messages
46
Hi,

I need help on the following:

I have a workbook - rainy.xls
worksheets inside the workbook - red,blue,yellow

the active worksheet now is blue.

I need to know single line statement to accomplish the following:

How change the value of cell A1 of yellow of rainy.xls to 28 if the active worksheet is currently unknown ?

tks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Hi
try
Code:
workbooks("rainy.xls").sheets("yellow").range("a1").value=28
 

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
try something like this macro

Sub test()
Dim x As Worksheet
For Each x In ThisWorkbook.Worksheets
If x.Cells.Interior.ColorIndex = 4 Then
x.Select
Range("a1").Select
Exit Sub
End If
Next
End Sub
 

Forum statistics

Threads
1,141,142
Messages
5,704,529
Members
421,353
Latest member
jekoxien15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top