![]() |
what's wrong with this paste line??
This is the script I have to update a table. I'm getting a run tim error in the highlighted line...please help Sub UpdateTable() Dim rng As Range, cell As Range, rng2 As Range Dim xcol As Double, ycol As Double Worksheets("WorkPage").Select Range("Z5").Select xcol = ActiveCell.Value Range("AA5").Select ycol = ActiveCell.Value With Worksheets("WorkPage") Set rng = .Range(.Cells(6, 26), .Cells(6, 26)) End With For Each cell In rng Worksheets("MinimumBoilingRipple").Range(cell.Offs et(-1, 0).Value cell.Offset(-1, 1).Value).Value = cell.Offset(1, 0).ValueNext End Su -- Tre_coo ----------------------------------------------------------------------- Tre_cool's Profile: http://www.excelforum.com/member.php...fo&userid=2641 View this thread: http://www.excelforum.com/showthread.php?threadid=46716 |
what's wrong with this paste line??
Since plain text newsgroup messages don't have "highlights", I'll assume
it's the line just before "End Sub": The Range method syntax you're trying to use requires two range objects as arguments, e.g.: Worksheets("MinimumBoilingRipple").Range(cell.Offs et(-1, 0), _ cell.Offset(-1, 1)).Value = ... Using the Value of the cells returns either numbers or strings, so Range() doesn't know what to do with them. In article , Tre_cool wrote: This is the script I have to update a table. I'm getting a run time error in the highlighted line...please help Sub UpdateTable() Dim rng As Range, cell As Range, rng2 As Range Dim xcol As Double, ycol As Double Worksheets("WorkPage").Select Range("Z5").Select xcol = ActiveCell.Value Range("AA5").Select ycol = ActiveCell.Value With Worksheets("WorkPage") Set rng = .Range(.Cells(6, 26), .Cells(6, 26)) End With For Each cell In rng Worksheets("MinimumBoilingRipple").Range(cell.Offs et(-1, 0).Value, cell.Offset(-1, 1).Value).Value = cell.Offset(1, 0).ValueNext End Sub |
what's wrong with this paste line??
so how can I fix this -- Tre_coo ----------------------------------------------------------------------- Tre_cool's Profile: http://www.excelforum.com/member.php...fo&userid=2641 View this thread: http://www.excelforum.com/showthread.php?threadid=46716 |
what's wrong with this paste line??
I gave you an example. If that doesn't help, then you'll need to explain
why that suggestion didn't work, and what you want... In article , Tre_cool wrote: so how can I fix this? |
All times are GMT +1. The time now is 12:32 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com