Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default Set Range in one macro to range in another

I currently place well names(B-07 3) in column A by resizing the cell but i realize the size isn't always 279 as in the second macro but is always the size range between y and x or y-x of the first macro. How can i set the second macro resize or paste range of the well the same range size as x and y fron the first macro. Trick

Sub Macro3(

' Macro3 Macr
' Macro recorded 2/24/2004 by Husky Use

Dim z As Rang
Sheets("Eclipse").Selec
Range("A1").Selec
Cells.Find(What:="time", After:=ActiveCell, LookIn:=xlFormulas, LookAt
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=
False).Activat
Cells.Find(What:="days", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
.Selec
Set z = ActiveCel
Cells(z.Row + 2, "B").Selec

x = ActiveCell.Addres
Selection.End(xlDown).Selec
y = ActiveCell.Addres
Range(x, y).Selec
Application.CutCopyMode = Fals
Selection.Cop

Sheets("Sheet1").Selec
Range("B2").Selec
ActiveSheet.Past
cLastRow = Cells(Rows.Count, "B").End(xlUp).Ro
Cells(cLastRow + 1, "B").Selec
ActiveSheet.Past
cLastRow = Cells(Rows.Count, "B").End(xlUp).Ro
Cells(cLastRow + 1, "B").Selec
ActiveSheet.Past

Sheets("Sheet2").Selec
Range("B2").Selec
ActiveSheet.Past
cLastRow = Cells(Rows.Count, "B").End(xlUp).Ro
Cells(cLastRow + 1, "B").Selec
ActiveSheet.Past
cLastRow = Cells(Rows.Count, "B").End(xlUp).Ro
Cells(cLastRow + 1, "B").Selec
ActiveSheet.Past
cLastRow = Cells(Rows.Count, "B").End(xlUp).Ro
Cells(cLastRow + 1, "B").Selec
ActiveSheet.Past
cLastRow = Cells(Rows.Count, "B").End(xlUp).Ro
Cells(cLastRow + 1, "B").Selec
ActiveSheet.Past

Sheets("Sheet2").Selec
Columns("B:B").Selec
Selection.NumberFormat = "mm/dd/yy

Sheets("Sheet1").Selec
Columns("B:B").Selec
Selection.NumberFormat = "mm/dd/yy

End Su


Sub Name_Format(

' Name_Format Macr
' Macro recorded 2/24/2004 by Husky Use


Sheets("Sheet2").Selec
Range("A2").Selec
ActiveCell.FormulaR1C1 = "B-07 1
x = Cells(65536, "A").End(xlUp).Ro
Cells(x, "A").Copy Cells(x, "A").Resize(279, 1

cLastRow = Cells(Rows.Count, "A").End(xlUp).Ro
Cells(cLastRow + 1, "A").Value = "B-07 4
y = Cells(65536, "A").End(xlUp).Ro
Cells(y, "A").Copy Cells(y, "A").Resize(279, 1

cLastRow = Cells(Rows.Count, "A").End(xlUp).Ro
Cells(cLastRow + 1, "A").Value = "B-07 6
z = Cells(65536, "A").End(xlUp).Ro
Cells(z, "A").Copy Cells(z, "A").Resize(279, 1

cLastRow = Cells(Rows.Count, "A").End(xlUp).Ro
Cells(cLastRow + 1, "A").Value = "B-07 7
k = Cells(65536, "A").End(xlUp).Ro
Cells(k, "A").Copy Cells(k, "A").Resize(279, 1

cLastRow = Cells(Rows.Count, "A").End(xlUp).Ro
Cells(cLastRow + 1, "A").Value = "B-07 8
v = Cells(65536, "A").End(xlUp).Ro
Cells(v, "A").Copy Cells(v, "A").Resize(279, 1




Sheets("Sheet1").Selec
Range("A2").Selec
ActiveCell.FormulaR1C1 = "B-07 2
a = Cells(65536, "A").End(xlUp).Ro
Cells(a, "A").Copy Cells(a, "A").Resize(279, 1

cLastRow = Cells(Rows.Count, "A").End(xlUp).Ro
Cells(cLastRow + 1, "A").Value = "B-07 3
b = Cells(65536, "A").End(xlUp).Ro
Cells(b, "A").Copy Cells(b, "A").Resize(279, 1

cLastRow = Cells(Rows.Count, "A").End(xlUp).Ro
Cells(cLastRow + 1, "A").Value = "B-07 5
c = Cells(65536, "A").End(xlUp).Ro
Cells(c, "A").Copy Cells(c, "A").Resize(279, 1


End Su

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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Macro deletes row in range, macro then skips the row moved up steven.holloway Excel Discussion (Misc queries) 8 June 11th 08 11:40 AM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Macro to input formula in range based on another range Peter Atherton Excel Programming 0 October 9th 03 12:47 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 04:07 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"