Calculating values with macro between worksheets

S

spolk

I Have the following problem: I wanted to calculate value "as" to th
column A in worksheet "Horizon_Measurements". When i try like below
the code stucks i this row and appears notification of typo error. Bu
if i keep on the same worksheet and calculate values to the column A
everything works fine, what stucks? How i should refer to the column
in sheet "Horizon_Measurements"


'This is not working

If LCase(Cells(SB, "H").Value) = "as" Then
Cells(SB, "Horizon_Measurements!A:A").Value = "SB203"

'This works

ElseIf LCase(Cells(SB, "H").Value) = "hts" Then
Cells(SB, "AB").Value = "SB501
 
B

Bernie Deitrick

spolk,

Change

Cells(SB, "Horizon_Measurements!A:A").Value = "SB203"

to

Worksheets("Horizon_Measurements").Cells(SB, "A").Value = "SB203"

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top