Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox has no arrow, just a line on the right, what's wrong? Tomatoman Excel Worksheet Functions 2 May 7th 10 06:35 PM
What is wrong with this line? ChartsToBe Charts and Charting in Excel 0 July 28th 06 12:08 AM
Something wrong in one line of VBA code Daniel Bonallack Excel Programming 6 June 29th 05 07:23 PM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM
What's wrong with this line of code? Sandy[_3_] Excel Programming 0 July 23rd 03 12:15 PM


All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"