Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi everyone,
I have two sheets in my workbook containing addresses. i.e. - Sheet("A") containing addresses from cell E2 downwards. - Sheet("B") capturing addresses from Sheet("A") from cell A5 How do I capture original address(unique address) from Sheet("A") and repeat it eight times in Sheet("B") from cell A5 downards and move on to the next unique address on Sheet("A"). e.g. If Range("E2:E5") in Sheet("A") are as below: E2: Brisbane (59) E3: Brisbane (79) E4: Perth (20) E5: Sydney (30) I want Sheet("B") from A5 to be as below: A5: Brisbane (59) A6: Brisbane (59) A7: Brisbane (59) A8: Brisbane (59) A9: Brisbane (59) A10: Brisbane (59) A11: Brisbane (59) A12: Brisbane (59) A13: Brisbane (79) A14: Brisbane (79) A15: Brisbane (79) A16: Brisbane (79) A17: Brisbane (79) A18: Brisbane (79) A19: Brisbane (79) A20: Brisbane (79) and so on... Thank you for your help in advance. Regards, James |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try:
Sub cus() Dim counter As Integer Dim i As Integer Dim cell As Range For Each cell In Sheets("A").Columns(5).Cells If Len(cell) 0 Then For i = 1 To 8 counter = counter + 1 Sheets("B").Cells(4 + counter, 1) = cell Next i Else Exit Sub End If Next cell End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
replace
For Each cell In Sheets("A").Columns(5).Cells with For Each cell In Sheets("A").Range("E2:E10000").Cells |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Perhaps something like this: Sub copycells() Dim Rng As Range, Rng1 As Long Dim MyCell As Range, oCell As Range Dim i As Long Set Rng = Sheets("Sheet1").Range("E2:E" & Range("E" & Rows.Count).End(xlUp)) For Each MyCell In Rng Rng1 = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(0, 1).Row MyCell.Copy Destination:=Sheets("Sheet2").Range(Cells(Rng1, 1), Cells(Rng1 + 8, 1)) Next End Sub -- The Code Cage Team Regards, The Code Cage Team 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=32425 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how does this formula work: =LOOKUP(2,1/((COUNTIF(D6:D41,""&D6:D41)=0)*(D6:D41<"")),D6:D41) | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Replacing "IF" or "LOOKUP" formula's with VBA Function? | Excel Programming | |||
Replacing "IF" or "Lookup" formulas with VBA function | Excel Programming | |||
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running | Excel Programming |