excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to fill a column from a different sheet and the next day fill
the next column over from the same sheet as that sheet is updated by a data
base daliy. I want to keep the information in the first column and continue
to move to the next column each day.
 
To do this you will need to create a macro. The code you need (bar any
tweaking to fit your purpose) is:

Sub placecols()

mycolnum = Sheets("Sheet1").Range("A1").End(xlToRight).Column + 1
Sheets("Sheet2").Columns("A").EntireColumn.Copy _
Sheets("Sheet1").Cells(1, mycolnum)

End Sub

Place this in a Module attached to the workbook. Each day, update the
information in the second sheet from the database and then run this macro.

DC
 
where sheet19 is the destination and sheet20 is the constant source and col
D (4)
Sub copycolumn()
With Sheets("sheet19")
lc = .Cells(1, Columns.Count).End(xlToLeft).Column + 1
Sheets("sheet20").Columns(4).Copy .Columns(lc)
End With
End Sub
 
Back
Top