Sub error

I have created this macro but everytime I run it the Columns it hides is 
incorrect. It hides FGHIJK it should only hide GHI. Can anyone tell me why 
this is happening?
Thank you for your help.


Sub Done_Changes()
'
' Done_Changes Macro
'

'
    Range("G11:H50").Select
    Selection.Locked = True
    Selection.FormulaHidden = False
    ActiveWindow.SmallScroll Down:=42
    Range("G54:H58").Select
    Selection.Locked = True
    Selection.FormulaHidden = False
    ActiveWindow.SmallScroll Down:=9
    Range("G62:H74").Select
    Selection.Locked = True
    Selection.FormulaHidden = False
    ActiveWindow.SmallScroll Down:=-72
    Range("D11").Select
    Columns("G:I").Select
    Range("G2").Activate
    Selection.EntireColumn.Hidden = True
    Range("D11").Select
End Sub


0
ed.davis1 (55)
7/4/2009 5:45:22 PM
excel 39879 articles. 2 followers. Follow

2 Replies
618 Views

Similar Articles

[PageSpeed] 10

When I run your Sub it hides only G:I
I am not sure why you get otherwise.

Why all the selections? And what is the purpose of the scrolls?
Would this not do just as well?

Sub Done_Change2()
    With Range("G11:H50")
       .Locked = True
       .FormulaHidden = False
    End With
    With Range("G54:H58")
     .Locked = True
     .FormulaHidden = False
    End With
    With Range("G62:H74")
         .Locked = True
         .FormulaHidden = False
    End With
    Columns("G:I").EntireColumn.Hidden = True
    Range("D11").Select
End Sub

best wishes
-- 
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Microsoft Communities" <Ed.Davis1@verizon.net> wrote in message 
news:%23rUpi6L$JHA.1492@TK2MSFTNGP03.phx.gbl...
>I have created this macro but everytime I run it the Columns it hides is 
>incorrect. It hides FGHIJK it should only hide GHI. Can anyone tell me why 
>this is happening?
> Thank you for your help.
>
>
> Sub Done_Changes()
> '
> ' Done_Changes Macro
> '
>
> '
>    Range("G11:H50").Select
>    Selection.Locked = True
>    Selection.FormulaHidden = False
>    ActiveWindow.SmallScroll Down:=42
>    Range("G54:H58").Select
>    Selection.Locked = True
>    Selection.FormulaHidden = False
>    ActiveWindow.SmallScroll Down:=9
>    Range("G62:H74").Select
>    Selection.Locked = True
>    Selection.FormulaHidden = False
>    ActiveWindow.SmallScroll Down:=-72
>    Range("D11").Select
>    Columns("G:I").Select
>    Range("G2").Activate
>    Selection.EntireColumn.Hidden = True
>    Range("D11").Select
> End Sub
>
> 

0
bliengme5824 (3040)
7/4/2009 4:28:31 PM
Didn't see a problem. Try this

Sub Done_ChangeSAS()
 With Range("G11:H50,G54:H58,G62:H74")
     .Locked = True
     .FormulaHidden = False
 End With
 Columns("G:I").Hidden = True
 End Sub


-- 
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"Microsoft Communities" <Ed.Davis1@verizon.net> wrote in message 
news:%23rUpi6L$JHA.1492@TK2MSFTNGP03.phx.gbl...
>I have created this macro but everytime I run it the Columns it hides is 
>incorrect. It hides FGHIJK it should only hide GHI. Can anyone tell me why 
>this is happening?
> Thank you for your help.
>
>
> Sub Done_Changes()
> '
> ' Done_Changes Macro
> '
>
> '
>    Range("G11:H50").Select
>    Selection.Locked = True
>    Selection.FormulaHidden = False
>    ActiveWindow.SmallScroll Down:=42
>    Range("G54:H58").Select
>    Selection.Locked = True
>    Selection.FormulaHidden = False
>    ActiveWindow.SmallScroll Down:=9
>    Range("G62:H74").Select
>    Selection.Locked = True
>    Selection.FormulaHidden = False
>    ActiveWindow.SmallScroll Down:=-72
>    Range("D11").Select
>    Columns("G:I").Select
>    Range("G2").Activate
>    Selection.EntireColumn.Hidden = True
>    Range("D11").Select
> End Sub
>
> 

0
dguillett1 (2487)
7/4/2009 4:56:59 PM
Reply:

Similar Artilces:

Duplicating MainForm, SubForm and Sub-SubForm
Hello Everyone, I have an Order Entry Form composed of a MainForm, a SubForm and 2 Sub- Subforms. The SubForm is a continuous form. The two Sub-SubForms are children of a SubForm via a foreign key (which is the Primary Key of a SubForm). There are some instances when customers revised their order by changing just the amount of orders or by just removing one item and the rest are the same. To do this, I would like to keep the initial order (record) and create another record by duplicating the first order then change the amount (or remove an item whatever the case maybe) on the new record. The...

overlapping error bars
I have created a chart which compares 2 sets of data on a line graph. I would like to add error bars to the chart, but when I do this they overlap making the chart uninterpretable. Ideally I'd like to move one line forwards or backwards along the x axis a small amount bringing the error bars out of phase with each other. I have not found a way of doing this using excel - does anyone know how to do this or any other way around this problem? thanks, Graham DOH! I have found the answer already from a previous post and have solved the problem by using an x-y chart instead of a line chart....

error: 1026 JET_errRecordTooBig
Hi, On all domaincontrollers in our Windows 2003 environment, the following error occurs since one week: Internal error: The security descriptor propagation task encountered an error while processing the following object. The propagation of security descriptors may not be possible until the problem is corrected. Object: CN=internal 79219437,CN=Microsoft Exchange System Objects,DC=bnl,DC=capgemini,DC=com Additional Data Error value: -1026 JET_errRecordTooBig, Record larger than maximum size Internal ID: 20903d5 We use Exchange 2003 sp1, with all hotfixes applied. Backend is clus...

error 2176
I have looked on this forum for this error, and the solutions haven't worked for me (guessing my code is a bit different). Basically, i want to load the values of a table into a combo box for selection, which did work before, but now i have exceeded the 2000 character limit on the string (i have taken over from someone else who worked on this form before, so did not forsee this problem until it happened) Here is the code to populate the combobox i use: Dim db As DAO.Database Dim rs As DAO.Recordset Dim strSource As String Set db = CurrentDb Set rs = db.OpenRecordset(&...

Circular reference error
Hi Guys, Using Excel 2000. I have a workbook that is already saved. When I open the workbook I get this error. MS Excel cannot calculate a formula. There is a circular reference in an open workbook, but the references that cause it cannot be listed for you. Try editing the last formula you entered or removing it with the Undo command. Problem is, I don't know what I did last. There are about 8 sheets. How do I figure out which formula is a circular reference? I don't even know what that is, I am pretty much a beginner in excel. My formulas are not really formulas, they are j...

2003 code raises error in 2007
I have a reference in VBA to a subform of a subform, which works fine in Access 2003. In Access 2007, however, it results in "you have entered an invalid reference to the property Form/Report." This is the snippet of code: Private Sub SetFormProperties() 'called from form_open, makes all forms editable if edit mode was selected Dim ctrl As Control, ctrlSub As Control Dim frm As Form If Me.OpenArgs = "Edit" Then Set frm = Me 'set main form edit options EditProperties frm 'set subform edit options For Each ctrl In frm If ct...

Outlook 2000 Sub folder
Hi I am using outlook 2000 and I have a created a subfolder in my inbox however I am unable to view the folder My Shortcuts on the left hand side of the screen where all my other sub folders are located. In the navigation bar at the top of my pane there is an icon called "move to Folder" and the folder is located here. I am unable to find the location of the folder therefore unable to open the folder or move it to "My shortcuts" I am in need of your expertise. I am ok with computers and can follow instructions so please please please help. Thanking you in ...

Error in Importng Photo
I've edited a photo in Microsoft Picture It! and saved as a jpeg file. When I attempt to import this file into Publisher I receive the message: "Error in Importing file." Does this happen with any other files? -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. "Chris" <anonymous@discussions.microsoft.com> wrote in message news:35422F55-47BD-4ABC-BD80-0E32553678AA@microsoft.com... > I've edited a photo in Microsoft Pi...

Error code 80070490
Hello Every one I am a Vista user but whenever trying to install Update for Windows Vista (KB972145) showing an error code-80070490. Please help me. Thank you. -- nandanchak ------------------------------------------------------------------------ nandanchak's Profile: http://forums.techarena.in/members/180874.htm View this thread: http://forums.techarena.in/vista-help/1298431.htm http://forums.techarena.in ...

REPOST: Unable to recieve mail on second SMTP address. Relay error
I have a single SBS2003 running Exchange. We want to host an additional SMTP domain (blackstonecanmore.ca). I have update the MX record and www.dnsreport.com says everything in the Internet DNS setup is correct. The problem now is I'm getting "Unable to Relay" bounce back messages when sending mail to this secondary domain. I have added the domain name to the recipient policy, the "This Exchange server..." is checked on and I've updated all of the AD user accounts. I've also restarted all of the Exchange services. I can send mail internally to that SMTP...

Exch 2003 Exmerge from Recovery Storage Group --- error 0x8004011d
I hope someone can share some insight on this because I've researched this and tried everything I can find to try -- I have a single Exchange 2003 SP2 organization with First Storage Group. Created a Recovery Storage Group and added database to it. Restored online backup, specifying Last Backup Set. Database restores fine and mounts successfully. Attempts to recover any of the listed mailboxes either by using Exmerge (latest version) to PST or by Recover Mailbox procedure generates errors. Excerpt from Exmerge log is "Error opening message store (MSEMS). Verify that the Microsoft...

sub-process
What is the sub-process function in the workflow? How do you set one up? Why would you use it? A sub-process is a way to call a manual rule. If you create a manual rule in workflow called Rule A, in another rule you can insert a sub-process and select the manual rule to run. This is a helpful way to create loops and if/then rules that trigger other events. -- Matt Wittemann http://icu-mscrm.blogspot.com "David M" wrote: > What is the sub-process function in the workflow? > How do you set one up? > Why would you use it? > ...

DST patch Errors
Is there a list of errors (and fixes) for the DST patches? We've spent hours with the support documents (914387 and the msexchangeteam blog "Step by step...") and the patches but continue to generate errors on our production systems. Yes: we have an account with full and send as rights to all 4000 mailboxes; the clients all the appropriate desktop patch; the servers are all patched; Exchange 2003 Enterprise servers are all patched. Active Directory 2003, native, all servers run Windows 2003 std or ent, fully patched, Exchange 2003 Ent fully patched, on a cluster with front...

Read Only error 11-09-07
I have a database whichworks fine when the first user enters, but any subsequent user is told that they can only open the database as read only. I think the network security setting are correct. Any suggestions? What are the network security settings? Each user requires at least Read, Write and eXecute on the folder where the database exists. (It's usual, but not mandatory, to give them Delete on the folder as well) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "JP Jones" <JPJones@discussions.microsoft.com> wrote in message ne...

error C2440
I get this error: error C2440: '=' : cannot convert from 'void (__cdecl Plotter3D::*)(class CArray<int,int> *,class CArray<int,int> *)' to 'void (__cdecl *)(class CArray<int,int> *,class CArray<int,int> *)' on this statement: emParameters->fp1 = view->display3D_class->ShowMeasurements; fp1 is declared like this: void (*fp1)(CArray <BOOL, BOOL> *envelopetodisplay, CArray <BOOL, BOOL> *measuretodisplay); and ShowMeasurements is a member of Plotter3D and declared like this: void __cdecl ShowMeasurements(CArray <BOOL, BOOL&...

Inconsistency Error
I am getting above error while I try to restart my exchange services. It looks like my Public folder PUB.EDB is corrupted. I tried eseutil/r and eseutil/p, but nothing is fixing. I have very imported contact folders in there. Can someone please show me how to fix this ? Thx Hello, This article is written for Exchange 5.5, which I am assuming you are running by the name of your databases. 185577 XADM: Error 1120 and 5000 Occurs When Starting Information Store http://support.microsoft.com/?id=185577 Basically if you ran ESEUTIL /P against your PUB.EDB, you need to delete all your...

Sub, Private Sub, Public Sub
I got a different lap top and when I moved my Personal.xls from one to the other some of my macros were not on the list of macros when you go to tools>macros. Although when I look in the code they are there. I figured out that the ones that were "Private Sub" macros were no working. I also figured that when I changed them to just "Sub" they worked. I do know that if "It aint broke don't fix it, cus to try is usually to fix it till it is broke." But what is the difference between "Sub", "Private Sub", & "Public ...

Fatal Error in Scanpst
This errror ocurrs when i was tunning the scanpst.exe: Fatal Error: 80040900. Somebody knows how can i fix it?? Thanks! ...

Synchronisation Errors
Hi There I have this problem in Customer tables... Scenario. Customer A created at store as local customer and account Type as COD with AccountTypeID = 1 ... 401 occurs.... details are uploaded to HQ... when I run reports and SQL quries to view customer details at HQ... Customer A has Account Type Account with AccountTypeID = 2. Would any one be able to help why is this happening and if there is a fix for this. -- Cheers Topi On Mon, 16 Apr 2007 08:58:06 +0200, Topi <Topi@discussions.microsoft.com= > = wrote: > run reports and SQL quries to view customer details at HQ....

Cascade current view to sub-folders
Hi, Is there any way I can set a custom View setting to a set of folders (e.g. set a view setting for a high-level folder and then have it cascade to all sub-folders)? By a custom View I mean the way that items in a folder shoud look - i.e. font settings and the like. Cheers, Stu ...

CTestDoc* GetDocument() errors in view class
I am getting these errors in my view header: error C2143: syntax error : missing ';' before '*' error C2501: CTestDoc: missing storage-class or type specifiers error C2501: 'GetDocument' : missing storage-class or type specifiers for this statement: CTestDoc* GetDocument(); Currently, I am using class CTestDoc; earlier in the file to satisfy the need. Can I get some help on this? Much appreciated! At the top of your .cpp file put: #include "TestDoc.h" Or whatever the name of your file is. KS "Steve Russell" <srussell@innernet.net&g...

compile error
I have a module that's returning a compile error during a compile. I've placed <<>> around the line that the debugger points to. Any ideas? Thanks in advance! Function Strip(vPhrase, sBadChars As String) ' Purpose: remove any of the characters in sBadChars from vPhrase Dim sPhrase As String Dim i As Integer If IsNull(vPhrase) Or IsEmpty(vPhrase) Or Len(sBadChars) = 0 Then Strip = vPhrase Else sPhrase = vPhrase i = 1 Do Until i > Len(sPhrase) << Do Until InStr(sBadChars, Mid$(sPhrase, i, 1)) = 0 O...

Suspect the corrupted company db cause an error when delete/create GP user on another db
In this SQL2000 instance, there are 3 company databases (WSSB, TWSSB and ZZZ) and also is has DYNAMICS. WSSB -- Live company db TWSSB -- Training db ZZZ -- Testing db Logon GP with sa to WSSB, and then GP9 >> Tools >> Setup >> System >> Users then delete a user account and error prompted - is related to stored procedure missing on "another" db named ZZZ. I feel weird so then I try to change company to ZZZ, and the similar error prompted - is related to missing stored procedure on ZZZ db. And I do not successfully logon to ZZZ. So, I wonde...

(Sub)totals
Hello everybody. I have the following problem: I have an Excel file with Column B 'Quantity' and column F 'Sector'. Now i need to count all the quantities within the same sector Sorting + AutoSum isn't an option, since the file has other calculations in it as well, that also depend on a sort. There's in my Dutch version a function 'DBSUM' and a function 'TURNTABEL.FETCH' ... these are translated terms, so I don't know if they match with English versions ... but could someone please tell me how these functions work, since i can't get them right (n...

Getting error in outlook
hi steve here i am getting error in outlook o/s : 98 Error: Unable to display the folder. Microsoft Outlook could not access the specified folder location. Errors have been detected in the file C:\WINDOWS\Local Settings\Application Data\Microsoft\Outlook\Outlook.pst. Quit all mail-enabled applications, and then use the Inbox Repair Tool. any help would be appreciated >hi steve here >i am getting error in outlook >o/s : 98 > >Error: >Unable to display the folder. >Microsoft Outlook could not access the specified folder location. >Errors have been detected in ...