Jumat, 31 Januari 2014

[belajar-excel] Digest Number 2759

5 New Messages

Digest #2759
1b
Re: kode macro sort expand selection [1 Attachment] by "hendrik karnadi" hendrikkarnadi
1d
Re: kode macro sort expand selection by "Mr. Kid" nmkid.family@ymail.com
2a
Re: Pisah kata, alt enter by "Bagus" bagus4bls

Messages

Thu Jan 30, 2014 6:38 am (PST) . Posted by:

achbar_auto

Kepada para master

saya mohon pencerahannya untuk kode macro dlm sorting data
saya sudah coba buat code macro untuk menjalankan SORT data,
tapi blm bisa untuk mejalankan fitur Sort Expand the Selection (seperti sorting manual)
saya lampirkan file contoh

mohon bantuannya untuk Kode macro
terima kasih atas bantuannya

Akbar


Thu Jan 30, 2014 7:39 am (PST) . Posted by:

"hendrik karnadi" hendrikkarnadi

Hai Akbar,
Coba bandingkan macro yang anda buat (macro1) dengan macro yang saya dapat melalui rekaman (macro2) berikut ini:
Sub Macro1()
    ActiveWorkbook.Worksheets("DATABASE").AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("DATABASE").AutoFilter.Sort.SortFields.Add Key:= _
        Range("A4:A58"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortNormal
    With ActiveWorkbook.Worksheets("DATABASE").AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub

Sub Macro2()
    ActiveWorkbook.Worksheets("DATABASE").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("DATABASE").Sort.SortFields.Add Key:=Range("A4:A15" _
        ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal'Macro1() A4:A58
    With ActiveWorkbook.Worksheets("DATABASE").Sort
       .SetRange Range("A3:D15")'Macro1() tidak ada
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub

File tidak dilampirkan agar anda bisa mencobanya sendiri.

Salam,
HK

On Thursday, 30 January 2014, 21:39, "achbar_auto@yahoo.com" <achbar_auto@yahoo.com> wrote:

 
Kepada para master

saya mohon pencerahannya untuk kode macro dlm sorting data
saya sudah coba buat code macro untuk menjalankan SORT data,
tapi blm bisa untuk mejalankan fitur Sort Expand the Selection (seperti sorting manual)
saya lampirkan file contoh

mohon bantuannya untuk Kode macro
terima kasih atas bantuannya

Akbar

Thu Jan 30, 2014 8:07 am (PST) . Posted by:

"M. Akbar" achbar_auto

waahh........ siip, matur nuwun.... om hendrik    tidak serumit yang dibayangkan.

Pada Kamis, 30 Januari 2014 22:42, hendrik karnadi <hendrikkarnadi@yahoo.com> menulis:

 
Hai Akbar,
Coba bandingkan macro yang anda buat (macro1) dengan macro yang saya dapat melalui rekaman (macro2) berikut ini:
Sub Macro1()
    ActiveWorkbook.Worksheets("DATABASE&quot;).AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("DATABASE&quot;).AutoFilter.Sort.SortFields.Add Key:= _
        Range("A4:A58"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortNormal
    With ActiveWorkbook.Worksheets("DATABASE&quot;).AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub

Sub Macro2()
    ActiveWorkbook.Worksheets("DATABASE&quot;).Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("DATABASE&quot;).Sort.SortFields.Add Key:=Range("A4:A15" _
        ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal&#39;Macro1() A4:A58
    With ActiveWorkbook.Worksheets("DATABASE&quot;).Sort
       .SetRange Range("A3:D15")'Macro1() tidak ada
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub

File tidak dilampirkan agar anda bisa mencobanya sendiri.

Salam,
HK

On Thursday, 30 January 2014, 21:39, "achbar_auto@yahoo.com" <achbar_auto@yahoo.com> wrote:

 
Kepada para master

saya mohon pencerahannya untuk kode macro dlm sorting data
saya sudah coba buat code macro untuk menjalankan SORT data,
tapi blm bisa untuk mejalankan fitur Sort Expand the Selection (seperti sorting manual)
saya lampirkan file contoh

mohon bantuannya untuk Kode macro
terima kasih atas bantuannya

Akbar

Thu Jan 30, 2014 12:42 pm (PST) . Posted by:

"Mr. Kid" nmkid.family@ymail.com

Sepertinya ingin sort area range a4:d15 dengan kolom kunci sort adalah
kolom pertama (kolom A terpilih).
Coba perhatikan struktur methods sort milik object range :
*expression.Sort(Key1, Order1, Key2, Type, Order2, Key3, Order3, Header,
OrderCustom, MatchCase, Orientation, SortMethod, DataOption1, DataOption2,
DataOption3)*

expression bisa diganti dengan object range, baik dalam sebuah variabel
ataupun disebut secara langsung.
key1 sampai key3 bisa diisi salah satu range yang menjadi kunci
order1 sampai order3 dipilih xlascending atau xldescending tergantung
kebutuhan setiap key-nya
header dipilih xlyes kalau ada baris header dalam expression dan xlno kalau
tanpa baris header
orientation dipilih xlsortcolumns jika akan sort data per kolom
(baris-baris record hasil sort akan berubah letaknya). isi atau pilih
xlsortrows jika akan sort per baris (kolom-kolom tabel hasil sort akan
berubah letaknya)

[script1]
untuk kasus diatas, baris script-nya :
range("a4:d15").sort range("a4") , xlascending , header:=xlyes,
orientation:=xlsortcolumn

[script2]
jika range("a4:d15") disimpan dalam variabel range seperti variabel bernama
rngData, maka bentuknya menjadi :
dim rngData as range
set rngData=range("a4:d15")
*rngdata*.sort *rngdata.resize(1,1)* , xlascending , header:=xlyes,
orientation:=xlsortcolumn

script1 dan script2 bersifat statis. jika data berubah jumlah recordnya,
bisa jadi tidak semua record akan ter-sort. Dengan mengubah bentuk scipt1
menjadi bentuk script2, maka ada potensi untuk dikembangkan menjadi dinamis
mengikuti jumlah record data. Bagian yang perlu didinamiskan adalag script2
baris pendefinisi range yang akan di-sort, yaitu yang berbunyi :
set rngData=range("a4:d15")

Coba pelajari cara mendefinisikan range dari yang statis sampai dinamis
mulai dari sini<http://b-excel.blogspot.com/2013/09/belajarvba-011-range-01-berdasar-alamat.html>sampai
bagian yang ada
disini<http://b-excel.blogspot.com/2013/09/belajarvba-011-range-06-range-ke-range.html>
.

Wassalam,
Kid.

2014-01-30 hendrik karnadi <hendrikkarnadi@yahoo.com>:

>
>
> Hai Akbar,
> Coba bandingkan macro yang anda buat (macro1) dengan macro yang saya dapat
> melalui rekaman (macro2) berikut ini:
> Sub Macro1()
> ActiveWorkbook.Worksheets("DATABASE&quot;).AutoFilter.Sort.SortFields.Clear
> ActiveWorkbook.Worksheets("DATABASE&quot;).AutoFilter.Sort.SortFields.Add
> Key:= _
> Range("A4:A58"), SortOn:=xlSortOnValues, Order:=xlAscending,
> DataOption:= _
> xlSortNormal
> With ActiveWorkbook.Worksheets("DATABASE&quot;).AutoFilter.Sort
> .Header = xlYes
> .MatchCase = False
> .Orientation = xlTopToBottom
> .SortMethod = xlPinYin
> .Apply
> End With
> End Sub
>
> Sub Macro2()
> ActiveWorkbook.Worksheets("DATABASE&quot;).Sort.SortFields.Clear
> ActiveWorkbook.Worksheets("DATABASE&quot;).Sort.SortFields.Add Key:=Range("
> A4:A15" _
> ), SortOn:=xlSortOnValues, Order:=xlAscending,
> DataOption:=xlSortNormal 'Macro1() A4:A58
> With ActiveWorkbook.Worksheets("DATABASE&quot;).Sort
> .SetRange Range("A3:D15") 'Macro1() tidak ada
> .Header = xlYes
> .MatchCase = False
> .Orientation = xlTopToBottom
> .SortMethod = xlPinYin
> .Apply
> End With
> End Sub
>
> File tidak dilampirkan agar anda bisa mencobanya sendiri.
>
> Salam,
> HK
>
>
> On Thursday, 30 January 2014, 21:39, "achbar_auto@yahoo.com" <
> achbar_auto@yahoo.com> wrote:
>
> Kepada para master
>
> saya mohon pencerahannya untuk kode macro dlm sorting data
> saya sudah coba buat code macro untuk menjalankan SORT data,
> tapi blm bisa untuk mejalankan fitur Sort Expand the Selection (seperti
> sorting manual)
> saya lampirkan file contoh
>
> mohon bantuannya untuk Kode macro
> terima kasih atas bantuannya
>
> Akbar
>
>
>
>
>

Thu Jan 30, 2014 4:39 pm (PST) . Posted by:

"Bagus" bagus4bls

Buka sheet baru,
Pilih cell A1, tekan tombol F2
lalu tekan tombol Alt+Enter

Pada cell B1 ketik =Code(A1)
Lihat hasilnya..

Wassalam

~ Bagus ~

----- Original Message -----
From: Abeutthank
To: belajar-excel@yahoogroups.com
Sent: Thursday, January 30, 2014 11:16 AM
Subject: Re: [belajar-excel] Pisah kata, alt enter

Terimakasih pak. Ternyata alt enter jadi char(10).

Char 10 itu apa ya pak? Ndada di help excell.
Bdw rumusnya sangat sesuai keinginan.
Makasih pak
Wassalam

Sent from Samsung Mobile

Bagus <bagus@kingjim.co.id> wrote:



Maaf seharusnya begini:

Coba begini pada B1:
=TRIM(MID(SUBSTITUTE($A1,CHAR(10),REPT(CHAR(10),LEN($A1))),((COLUMNS($A:A)-1)*LEN($A1))+1,LEN($A1)))

Wassalam

~ Bagus ~

----- Original Message -----
From: Bagus
To: belajar-excel@yahoogroups.com
Sent: Thursday, January 30, 2014 7:53 AM
Subject: Re: [belajar-excel] Pisah kata, alt enter



Hai Utthank;

Coba begini pada B1:
=TRIM(MID(SUBSTITUTE($A6,CHAR(10),REPT(CHAR(10),LEN($A6))),((COLUMNS($A:A)-1)*LEN($A6))+1,LEN($A6)))

Copas kekanan

Wassalam

~ Bagus ~

----- Original Message -----
From: Abeutthank
To: belajar-excel@yahoogroups.com
Sent: Thursday, January 30, 2014 7:27 AM
Subject: [belajar-excel] Pisah kata, alt enter

Azw

Saya ada kasus sbb:
- di sel a1 ada 3 baris kata
- tiap barisnya di pisahkan dgn alt enter
- tidak ada spasi pada akhir kata
Yg ingin saya lakukan
Memisahkan 3 baris kata d sel a1 tersebut di sel b1 b2 dan b3
Ex
Di Sel a1 tertulis:
kepada[alt enter]
yth[alt enter]
abeutthank

Yg di inginkan kata tersebut terpecah jadi:
B1: kepada
B2: yth
B3: abeutthank

Terimakasih
Wassalam

Sent from Samsung Mobile

GROUP FOOTER MESSAGE
=====================================================================
Untuk memudahkan tim penyusun materi Belajar Excel yang lebih sesuai kebutuhan member, silakan ungkapkan permasalahan yang kerap ditemui dalam menggunakan Excel sehari-hari atau hal-hal yang ingin dipelajari dalam jangka dekat ini. Mohon diprioritaskan dari yang sering ditemui sampai yang ingin dipelajari.
Isi sesuai kelompoknya (fitur-fitur, formula-formula tertentu yang masih membingungkan, otomasi atau pemrograman dalam Excel [Macro - VBA], hal lainnya yang membuat Anda kesulitan dalam mempelajari Excel).
Boleh mengisi berulang kali untuk menambah uneg-uneg yang ingin diungkapkan.
Link untuk menuangkan seluruh uneg-uneg tersebut ada di :
http://tech.groups.yahoo.com/group/belajar-excel/database?method=addRecord&tbl=3
=====================================================================
Langkah kecil Anda dalam mengisi database bisa menjadi langkah pertama yang bermanfaat besar untuk kita semua.
=====================================================================

---------------------------------------------------------------------
bergabung ke milis (subscribe), kirim mail kosong ke:
belajar-excel-subscribe@yahoogroups.com

posting ke milis, kirimkan ke:
belajar-excel@yahoogroups.com

berkunjung ke web milis
http://tech.groups.yahoo.com/group/belajar-excel/messages

melihat file archive / mendownload lampiran
http://www.mail-archive.com/belajar-excel@yahoogroups.com/
atau (sejak 25-Apr-2011) bisa juga di :
http://milis-belajar-excel.1048464.n5.nabble.com/

menghubungi moderators & owners: belajar-excel-owner@yahoogroups.com

keluar dari membership milis (UnSubscribe):
kirim mail kosong ke  belajar-excel-unsubscribe@yahoogroups.com
---------------------------------------------------------------------
READ MORE....

[smf_addin] Digest Number 2949

9 New Messages

Digest #2949
1a
obsolete by "Christopher Kline" hardpressedsalami@att.net
1b
Re: obsolete by "Randy Harmelink" rharmelink
2a
3a
3b
Re: What did I do wrong? by "Randy Harmelink" rharmelink
3f
Re: What did I do wrong? by "Randy Harmelink" rharmelink

Messages

Thu Jan 30, 2014 3:26 pm (PST) . Posted by:

"Christopher Kline" hardpressedsalami@att.net

I downloaded the new element definitions as of 2014-01-30.

2,25, 27-32, 35, 36 all show a strike through and are obsolete.

Should I download the previous version?

I am running Office 2010 student/home.

PS: my desktop's software is running fine. I downloaded that a couple days ago.

Thanks for your help

Thu Jan 30, 2014 3:30 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

The previous version won't help. Those elements were obsoleted because MSN
redesigned their stock print page last year and dropped those data items
from the web page. All except element #25. Ever since they redid the web
page, the "Last Price" they've been posting has actually been the previous
day's closing price.

Use RCHGetYahooQuotes() to get current quotes. It can return a number of
data items on up to 200 ticker symbols, with a single Internet access.

On Thu, Jan 30, 2014 at 3:18 PM, Christopher Kline <
hardpressedsalami@att.net> wrote:

>
> I downloaded the new element definitions as of 2014-01-30.
>
> 2,25, 27-32, 35, 36 all show a strike through and are obsolete.
>
> Should I download the previous version?
>
> I am running Office 2010 student/home.
>
> PS: my desktop's software is running fine. I downloaded that a couple days
> ago.
>
>

Thu Jan 30, 2014 4:45 pm (PST) . Posted by:

graham_blaah

That's so cool. I shall implement that forthwith. Thanks.


The other comment was a duplicate response - internet issues and I didn't know the first one got through. Not a flippant response to your always helpful posts.


I seem to be getting the hang of it now. At least the basics.


Thanks again.

Thu Jan 30, 2014 8:05 pm (PST) . Posted by:

tonyestep

I just updated and now my simple closing-price sheet doesn't work. I'm using the formula:


=RCHGetYahooQuotes(A2:A100,B1:M1)



In A2: A100 are tickers, and in row 1 are items: p, l1, etc. This worked until I updated. All I did was move the new .xla file into the directory where the previous one was located. Where did I screw up? Thanks.....

Thu Jan 30, 2014 8:09 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

Try exiting EXCEL and unzipping *all* files from the ZIP archive into your
add-in folder (not just the XLA file). Then restart EXCEL and see if you
still have the problem.

If you still have a problem, verify you *are* using the new version, with:

=RCHGetElementNumber("Version&quot;)

On Thu, Jan 30, 2014 at 9:02 PM, <tonyestep@yahoo.com> wrote:

>
> I just updated and now my simple closing-price sheet doesn't work. I'm
> using the formula:
>
> =RCHGetYahooQuotes(A2:A100,B1:M1)
>
> In A2: A100 are tickers, and in row 1 are items: p, l1, etc. This worked
> until I updated. All I did was move the new .xla file into the directory
> where the previous one was located. Where did I screw up? Thanks.....
>

Thu Jan 30, 2014 8:33 pm (PST) . Posted by:

tonyestep

Nope, same result. The RCHGetElementNumber("Version&quot;) call returns:


Stock Market Functions add-in, Version 2.1.2014.01.30 (C:\Users&#92;Public&#92;Documents&#92;Work&#92;RCH_Addin; ; 1)

Thu Jan 30, 2014 8:36 pm (PST) . Posted by:

tonyestep

Instead of prices, the Price call returns:


src="http://chart.yahoo.com/c//e/edv.gif" alt="Chart&quot;><br><table><tr><td width=512 align=center><font face=arial size=-1></font></td></tr></table>"

BTW, thanks very much for your reply, Randy, and thanks a lot for this terrific add-in!!

Thu Jan 30, 2014 8:56 pm (PST) . Posted by:

tonyestep

I backed down to the version of 1/1/2009 and it works okay. Presumably something changed a long time ago and my method of calling for prices became obsolete, but I didn't update and didn't notice it. It must be my way of calling for quotes: =RCHGetYahooQuotes(A2:A100,B1:M1) which apparently is no longer the way you call for quotes.

Thu Jan 30, 2014 9:01 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

That's the way I still do it...the template in the FILES area uses:

=RCHGetYahooQuotes(B4:B203,C2:V2)

Can you attach a copy of your workbook?

On Thu, Jan 30, 2014 at 9:56 PM, <tonyestep@yahoo.com> wrote:

> I backed down to the version of 1/1/2009 and it works okay. Presumably
> something changed a long time ago and my method of calling for prices
> became obsolete, but I didn't update and didn't notice it. It must be my
> way of calling for quotes: =RCHGetYahooQuotes(A2:A100,B1:M1) which
> apparently is no longer the way you call for quotes.
>
READ MORE....