ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculating values with macro between worksheets (https://www.excelbanter.com/excel-programming/298046-calculating-values-macro-between-worksheets.html)

spolk[_3_]

Calculating values with macro between worksheets
 
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

--
Message posted from http://www.ExcelForum.com


Bernie Deitrick

Calculating values with macro between worksheets
 
spolk,

Change

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

to

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

HTH,
Bernie
MS Excel MVP

"spolk " wrote in message
...
I Have the following problem: I wanted to calculate value "as" to the
column A in worksheet "Horizon_Measurements". When i try like below,
the code stucks i this row and appears notification of typo error. But
if i keep on the same worksheet and calculate values to the column AB
everything works fine, what stucks? How i should refer to the column A
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"


---
Message posted from http://www.ExcelForum.com/




spolk[_4_]

Calculating values with macro between worksheets
 
Thanks Bernie! this works and again going forward toward ne
obstacles..

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 08:13 PM.

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