Link to home
Start Free TrialLog in
Avatar of route217
route217Flag for United Kingdom of Great Britain and Northern Ireland

asked on

update current macrot to add boarders to a cell range

Hi experts

How would you amend the current vba in MS Access to add boarder to a range of data based on column A i.e. until the last cell with data in column A and until column AD.

Dim xlPath As String, xlObj As Object
Dim rs As DAO.Recordset, sql As String
Dim RootMIdir As String

Set xlObj = CreateObject("excel.application")
     xlObj.Workbooks.Open xlPath & "REPORT_1.xls"
     
     With xlObj
          .Worksheets("R_1").Select
          sql = "SELECT *"
          sql = sql & " FROM R_Data"
     
          Set rs = CurrentDb.OpenRecordset(sql)
         
          .Range("a2").CopyFromRecordset rs


I have removed the file path and the activeworkbook.save filename from the above code....
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

I would recommend that you add the Excel topic area to your request.  If you click Request Attention, request that a moderator add the Excel topic to your question.
Avatar of route217

ASKER

Hi Fyed..

I have tried this under the excel subject and getting no luck with the vba
Basically unable to complete the task...
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial