|
-
April 20th, 2012, 01:22 AM
#1
VBA & Excel: macro wont save column adjustments
Hello,
My Aim: i wish to place text in one sheet and adjust columns in another sheet using similar code or the code below
Problem: It runs the Sub however, it executes the code to place the text 'XXX' in the correct spot, however it wont adjust the columns. Once i open
the file up the text is there but columns haven't changed.
I figured the code is similar so why is it executing and saving the text but not the column widths.
I think it might be that the column manipulation needs to be saved? If so, howr? If not any ideas?
(also this Sub is called from a macro that runs over an Excel file, that (the macro) is called from a form in Access)
Sample code
[Private Sub editCols()
Dim frontSht As Worksheet
Set frontSht = Sheets("Front_sheet")
frontSht.Range("H2").Value = "XXX"
Dim backSht As Worksheet
Set backSht = Sheets("Full_Revision_History")
backSht.Columns("A:Q").AutoFit
backSht.Range("A:P").HorizontalAlignment = xlCenter
End Sub]
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|