Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
am trying to import data to Access. Exported excel file has following
layout Account_1 Date, Amount Date, Amount Account_2 Date, Amount Date, Amount I would like to move the Account cell value to different position, see below Account_1, Date, Amount Account_1, Date, Amount Account_2, Date, Amount Account_2, Date, Amount Is there any way to create VBA code that could do this for me? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Test()
Dim iLastRow As Long Dim i As Long Dim rng As Range Dim sTemp As String iLastRow = Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To iLastRow If IsDate(Cells(i, "A").Value) Then Cells(i, "A").Resize(, 2).Copy Cells(i, "B") Cells(i, "A").Value = sTemp Else If rng Is Nothing Then Set rng = Rows(i) Else Set rng = Union(rng, Rows(i)) End If If Cells(i, "A").Value < "" Then sTemp = Cells(i, "A").Value End If End If Next i If Not rng Is Nothing Then rng.Delete End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "talkto_menow" wrote in message ps.com... am trying to import data to Access. Exported excel file has following layout Account_1 Date, Amount Date, Amount Account_2 Date, Amount Date, Amount I would like to move the Account cell value to different position, see below Account_1, Date, Amount Account_1, Date, Amount Account_2, Date, Amount Account_2, Date, Amount Is there any way to create VBA code that could do this for me? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I switch from Office 2007 layout to the old 2003 layout? | Excel Discussion (Misc queries) | |||
changing default page layout | Setting up and Configuration of Excel | |||
Changing the Layout of a Pivot Table | Excel Discussion (Misc queries) | |||
Prevent user changing pivot chart layout | Excel Worksheet Functions | |||
Changing the layout of a series of fields from Column to row | Excel Discussion (Misc queries) |