Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Access to manipulate an Excel file.

Status
Not open for further replies.

OC2

IS-IT--Management
Apr 2, 2001
59
SG
Hi,

I am new to linking access to excel. I have a solution to a tedius task of rearranging unsorted data stored on an excel spreadsheet. As this report produces identical data placement, I want to use access to delete unwanted columns and rows with the touch of one button.

Could someone pls give me a push in the write direct, ie code to open an existing exel file, deleting a line or column and adding data in a specific field. If anyone can provide this I will be very greatful.
thx
 
Not sure if you can use this at all but,

If ExcelWasNotRunning = True Then MyXL.Application.Quit
FormMyXl
MyXL.ActiveWorkbook.ActiveSheet.Columns("B:AU").EntireColumn.AutoFit
MyXL.ActiveWorkbook.ActiveSheet.Range("C6").Select

Set MyXL = Nothing

As you can see I use this to make an autofit but if you know the columns you want to delete you could use this to delete (change autofit to delete)

Regards
 
Hi hermanlaksko,

As im pretty much completely new, could you pls help elaborate on this code. How would I apply this to an excel file called "test"

would it be in Access VB or an Excel macro.

Cheers for helping so far.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top