vba

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
320
Office Version
  1. 2007
Hello I have a VBA in a spreadsheet so that all data i enter aligns to the top and left. However when I copy over data from another spreadsheet it seems to override the vba formatting any ideas?

Thank you.


[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub Stuff()
Dim wks As Worksheet

For Each wks In Worksheets
wks.Cells.VerticalAlignment = xlTop
wks.Cells.HorizontalAlignment = xlLeft
Next wks
End Sub


[/FONT]
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hello,

You do not explain if you are copying manually or with a macro ...

You can alwyas have just the Values copied ...
 
Upvote 0
Copy and paste as values.
 
Upvote 0
After copying the data, right click the destination cell, click 'Paste Special' and select "Values". This assumes the copy paste is done manually.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top