Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Passing Addresses Instead of Values

I have a nice excel macro below that passes cell values on Input sheet (Ins)
to Output sheet (OS).
The macro examines Output sheet Column A for rows having some ..... and then
writes the appropriate InS row values to the ..... row. When 1 InS row is
written the macro increments to the next correct row pairs.
It works nicely with 20,000 row input sheets.

I want to alter the macro below so that an address is passed rather that a
value and leaves the InS and OS permanently linked. Verbally put:

InS.Range(InS.Cells(datarow, "A"), InS.Cells(datarow, "E")).Copy
Destination:=OS.Cells(i, "C")

needs to be altered to permanently write the correct cell addresses rather
than cell values.

Thanks ahead of time,

John

Macro

Sub In2Out()
'
' In2Out Macro
' Macro recorded 5/42006 by John Birken
Dim OS, InS As Worksheet

Set OS = Sheets("sheet3")
Set InS = Sheets("sheet2")

lastrow = OS.Cells(Rows.Count, "A").End(xlUp).Row
datarow = 1
For i = 10 To lastrow
If Left(OS.Cells(i, "A"), 4) = "...." Then
InS.Range(InS.Cells(datarow, "A"), InS.Cells(datarow, "E")).Copy
Destination:=OS.Cells(i, "C")
datarow = datarow + 1
End If
Next i

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Passing Addresses Instead of Values

Nel post
*John* ha scritto:

I have a nice excel macro below that passes cell values on Input
sheet (Ins) to Output sheet (OS).
The macro examines Output sheet Column A for rows having some .....
and then writes the appropriate InS row values to the ..... row. When
1 InS row is written the macro increments to the next correct row
pairs.
It works nicely with 20,000 row input sheets.

I want to alter the macro below so that an address is passed rather
that a value and leaves the InS and OS permanently linked. Verbally
put:

InS.Range(InS.Cells(datarow, "A"), InS.Cells(datarow, "E")).Copy
Destination:=OS.Cells(i, "C")

needs to be altered to permanently write the correct cell addresses
rather than cell values.

Thanks ahead of time,

John


Hi John,

I'm not sure, but I think you could use this line of code to link the two
cells:

OS.Cells(i, "C").Formula = "=" & InS.Range(InS.Cells(datarow, "A"),
InS.Cells(datarow, "E")).Address



--
(I'm not sure of names of menus, options and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


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
Passing values in Sheet to VBA Jonathan Charts and Charting in Excel 1 June 30th 06 06:00 AM
Passing values PhilM Excel Programming 2 June 14th 06 11:21 AM
Please help with passing values Frigid_Digit[_5_] Excel Programming 2 September 16th 05 06:29 AM
Passing Values Information Hog[_6_] Excel Programming 6 August 23rd 05 04:06 PM
Passing values to new app BrianG[_4_] Excel Programming 3 May 27th 04 01:58 PM


All times are GMT +1. The time now is 07:57 PM.

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

About Us

"It's about Microsoft Excel"