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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. BrianWilson

    ClearContents and ScreenUpdating issue

    Zygor, Implemented your fix: Sheets("RETU").Range("A7:L1000").Value = "" Works a treat and can't see how I missed that workaround! Many thanks BW
  2. BrianWilson

    ClearContents and ScreenUpdating issue

    Skip, Thanks for the input, but taking the basic exmaple where on Sheet1 there is a command button with the code Sheets("RETU").Range("A7", "L1000").ClearContents ..then I still get the Range error. If I precede the code with Sheets("RETU").Activate then it works. I can only presume this is...
  3. BrianWilson

    ClearContents and ScreenUpdating issue

    Hugh, I created a new workbook with your scenario: Private Sub CommandButton1_Click() Sheets(2).Range("A2:D3").ClearContents End Sub This does not work on my config (see above post). Whilst it's overkill, is there another way to inderctly code the ClearContents method without...
  4. BrianWilson

    ClearContents and ScreenUpdating issue

    Hugh, Thanks for that - I will try this out. System: Excel 97 SR-2 on NT4 SP2 (work PC!). Regards Brian
  5. BrianWilson

    ClearContents and ScreenUpdating issue

    Hugh, Thanks for the help. When I try this I get: Run-time error '1004' ClearContents method of Range class failed (When I put the Sheets("RETU").Activate code before your suggestion it runs OK - but note that I do not need to do this on the other sheets. However focus is still left on RETU...
  6. BrianWilson

    ClearContents and ScreenUpdating issue

    Hi all, Hoping you can assist, I'm all out on ideas! I have a Sub in a module which calls Subs on individual sheets. The Sub in the individual sheets needs to clear a range of cells, but I do not wish the focus to change to any of these sheets from the one the user is viewing. (Note: the Subs...
  7. BrianWilson

    leading zerso dropping off.

    If the return value is numeric then you cannot assume leading zeros will be displayed. If the number is converted to be displayed as a string then this can be done. Try: select right("00000" + convert(varchar(5),@your_number),5) Please note though that if you try and convert this back to an...
  8. BrianWilson

    Merge two files (newbie)

    All, An update to this issue I had. I have amalgamated the posts from PHV, vgersh99 and Ygor. To recap: Two files, one a configuration file, and one data: File Contents: columns.cfg HEADER,first,second,third,fourth data.txt Cat,Dog,Cow,Sheep Apple,Banana,Peach,Grape Blue,Yellow,Red,Green...
  9. BrianWilson

    Merge two files (newbie)

    PHV, Sure thing...not working exactly as I require it yet, but the code here should be enough for other codies to work with. #!/bin/ksh # NOTE: THIS CODE IS CONDENSED & SENSITIVE INFORMATION REMOVED/RENAMED. #------------initialise variables---------- set -x fDATE=`date +%Y%m%d`...
  10. BrianWilson

    Merge two files (newbie)

    vgersh & PHV, Yep, Solaris it is (we do have some awk scripts on the box, but nothing strangely as seemingly complicated as this!) I am still getting minor little errors, but I should be able to take it from here. Thanks once again for your time and assitance. A star to you both. Regards, Brian
  11. BrianWilson

    Merge two files (newbie)

    vgersh99 Hi! Thanks for your input on this matter. I have tried your suggestion, however, instead of an illegal statement message, it tells me it's bailing out. Here's the output: >>>>>>>> + [ -s /opt/test/conf/glexport.cfg ] + awk -F, -v Cols=/opt/test/conf/glexport.cfg BEGIN...
  12. BrianWilson

    Merge two files (newbie)

    PHV, Sorry do NOT want this to be a burden to you! Your help is very much appreciated. Sadly, I still get syntax error at line 2 and illegal statement near line 2. I've tried the following combos: BEGIN {getline<"`$Columns`";nf=NF;for(i=0;i<nf;++i) c[i]=$(i+1)} BEGIN...
  13. BrianWilson

    Merge two files (newbie)

    PHV, Done as you have suggested regarding variable name. Output is now >>>>>>> + awk -F, BEGIN {getline</opt/test/conf/columns.cfg;nf=NF;for(i=0;i<nf;++i) c[i]=$(i+1)} { printf "%s,%d",c[0],NR for(i=1;i<nf;++i) printf ",%s,%s",c[i],$i...
  14. BrianWilson

    Merge two files (newbie)

    Ygor, I tried your code suggestion (and changed the var name to CFG) but now I get: >>>> + awk BEGIN { OFS=FS=","; getline < ENVIRON["CFG"]; split($0,c); } { for(i=1;i<NF;i++){...
  15. BrianWilson

    Merge two files (newbie)

    PHV, I've had a try with this and get varying messages. Hope you can still assist with this issue. I'm using variable substitution for the filename so have: //// START CODE SNIPPET COLUMNS=$Root/conf/columns.cfg if [ -s $COLUMNS ] then awk -F, ' BEGIN...
  16. BrianWilson

    Merge two files (newbie)

    PHV, Wow! Thanks for the quick reply. It's much appreciated. I shall get my head around what is going on so I can underatand, and then see if it's OK in production. Hold tight....there could be a star on the way!...
  17. BrianWilson

    Merge two files (newbie)

    Hi all, Sorry for what may be a newbie question, but I've read what I can on awk and nawk and can't fathom this out. Any help would be greatly appreciated. I have two files. "columns.cfg" is a config file and "data.txt" is the data. columns.cfg (one single line) A,B,C,D,E,...etc. data.txt...

Part and Inventory Search

Back
Top