Re: moving columns to a new sheet

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Hi

You may want to try this

Sub copy_sheet1_sheet2()
Sheets("Sheet1").Select
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To rowcount
Sheets("Sheet1").Select
Range("a" & i).Select
val_a = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
val_c = ActiveCell.Value
ActiveCell.Offset(0, -1).Select
val_b = ActiveCell.Hyperlinks(1).Address
Sheets("Sheet2").Select
Range("A" & i).Select
ActiveCell.Value = val_a
Range("b" & i).Select
ActiveCell = val_b
Range("c" & i).Select
ActiveCell = val_c
Next
Call make_hyperlink
End Sub
Sub make_hyperlink()
Sheets("Sheet2").Select
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To rowcount
Range("b" & i).Select
adr = ActiveCell.Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=adr, _
TextToDisplay:=adr
Next
End Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=17532
View this thread: http://www.excelforum.com/showthread.php?threadid=560521

.



Relevant Pages

  • RE: VBA help w/ look & fill in data
    ... statementt is the only place in this sub that will cause a failure.. ... It just filled out blank data in sheet1. ... individual sheet. ... RowCount = RowCount + 1 ...
    (microsoft.public.excel.programming)
  • RE: VBA help w/ look & fill in data
    ... Sub checkso() ... Dim R1300M100 ... For Each cell In ColHRange ... RowCount = RowCount + 1 ...
    (microsoft.public.excel.programming)
  • RE: VBA help w/ look & fill in data
    ... Sub checkso() ... Dim R1300M100 ... For Each cell In ColHRange ... RowCount = RowCount + 1 ...
    (microsoft.public.excel.programming)
  • Re: Acronym Macro
    ... Sub Button1_Click ... FirstRow = RowCount ... You enter break mode when you suspend execution of code. ... came up that said "Compile error: Expected End Sub" do you have any thoughts ...
    (microsoft.public.excel.programming)
  • RE: Combining multiple IF statements
    ... sub Test() ... For RowCount = 1 to 100 ... DeleteRow to indicate when a row n eeded to be deleted. ... within this same macro id like to add many additional statements like ...
    (microsoft.public.excel.programming)