LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Passing Cell Address (String or Range)

I have 3 sheets. The firs is my main sheet, the 2nd and
third are temp sheets whihc I have created. I am copying
data from sheet 1 to the temp sheets. I want to copy to
temp1 by offseting by 1 volumn then to temp 2 by
offseting by 1 row. Currently having trouble setting up
the copy an paste range to do this.

I am tryint pass the cell address from sheet to a
varible. I then want to used this address with an offset
to set two other variables. I can pass the address to
the first variable by making the first variable a
string. However, this does not all be to pass offset
version of this address to the 2nd and 3rd variables. I
am assuming that this is because they are dimensioned as
ranges. Should I be defineing them all as ranges and use
the Set stmt?


Dim CopyStartCell As String
Dim TempSh2PasteCell As Range
Dim TempSh3PasteCell As Range

For Each sh In ActiveWorkbook.Worksheets
'Set up past ranges in temp sheets
CopyStartCell = sh.UsedRange.Cells(1, 1).Address
'Set Paste cell off 1 column to the right
TempSh2PasteCell = Worksheets(TempSh2Name).Range
(CopyStartCell).Offset(0, 1)
'Set Paste cell off 1 row below
TempSh3PasteCell = Worksheets(TempSh3Name).Range
(CopyStartCell).Offset(1, 0)
Next
 
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
return cell address of longest text string in a range Dave F[_2_] Excel Discussion (Misc queries) 2 July 12th 07 03:41 PM
Passing a Cell Range scott Excel Programming 1 March 1st 05 09:41 PM
Passing Cell Address to Offset Bob Excel Worksheet Functions 2 December 1st 04 04:56 PM
Passing a String in Array to Range as String [email protected] Excel Programming 2 September 1st 04 01:13 AM
Passing cell addressess to variables to be use in range ExcelMonkey[_146_] Excel Programming 2 June 11th 04 09:31 PM


All times are GMT +1. The time now is 02:52 PM.

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"