advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 37697 for IF (0.008 sec.)
[[20070129190214]]
#score: 1591
@digest: 5696cef0de2ac6b5889ad59a5fa3bff8
@id: 28284
@mdate: 2007-01-30T01:41:36Z
@size: 5447
@type: text/plain
#keywords: rex (39766), scnddata (29993), kuwake (22142), fstdata (20578), 区)" (19277), 市" (18075), srddata (15241), 県○ (13353), 市○ (11665), 郡| (11145), 郡" (10731), 市| (10563), 日市 (10332), 市郡 (8585), 市") (8558), 府| (8350), 八日 (8300), data (7872), 山| (7407), 区○○ (7080), pattern (6841), 郡山 (6745), execute (6725), 所c2 (6676), adrs2 (6648), 川| (5950), get (4886), 号b2 (4759), 太田 (4552), firstindex (4202), タ> (4104), sp (3101)
『顧客名簿の作成』(のだ)
今まで手書きしていた顧客名簿をパソコンで管理したく、 名簿にある郵便番号・住所(○県○市○区○○1-2-3)・名前 と数十件入力して、最終的にはこれを区ごとに分けたいのですが どういう手順で何をすれば出来ますか? データの並び替えでやってみたのですが、うまくいきません… 県は全て同じで市と区が違います。 うまく伝わったか分かりませんが…どなたかアドバイスお願いします。 ---- >住所(○県○市○区○○1-2-3) これは1つのセルに入力ですか? なら 見出しの住所を選択し データ>フィルタ>オートフィルタ で出てきた▼をポチッとすると オプションというのがあるので、 ○○区を含むで抽出する あるいは、郵便番号で抽出する方法もありますね (oni) ---- 郵便番号の一覧が↓で入手できます http://www.post.japanpost.jp/zipcode/dl/kogaki.html 県ごとにありCSVなのでそのままExcelに取り込めます コチラを利用してVLOOKUPで市や区を抽出してはいかがでしょうか? (e1tw)VLOOKUP http://www.excel.studio-kazu.jp/lib/e1tw/e1tw.html (Ohagi) ---- 先ず初めにAlt+F11でVBEを開き 挿入→標準モジュールを選択して下のコードを コピペします。 仮にデータがA2から郵便番号 B2が住所 C2が名前とデータが並んどるとします。 E2に=adrs2(B2)で下方向にコピーで市区が抽出でけますから、今度はF2に=kuwake(E2) とすると区だけが抽出でけます。 これも下方向へコピーし、今度はA列からF列までのデータ範囲を選択し、データ→ 並べ換えで優先順位F列にしてOKを押すと、区単位に見事並べかえられます。 E列F列をクリア、Alt+F11でModule1を右クリック→Module1を解放すれば残るのはキレ いに並べ変えられたデータが残るだけとなります。 (弥太郎) '----------------------- Dim fstdata As String, scnddata As String, srddata As String Dim data As String Public x As Variant Public adrs As Range Function adrs2(adrs As Range) data = adrs.Value sp = 2 work (sp) adrs2 = scnddata End Function Sub work(sp) Dim Rex As Object Dim sp_data As String Set Rex = CreateObject("vbscript.regexp") sp_data = "" Rex.Pattern = "^(大阪府|京都府|東京都|北海道)" If Rex.test(data) Then sp_data = Rex.Execute(data)(0) Else Rex.Pattern = "(^..|神奈川|和歌山|鹿児島)県" If Rex.test(data) Then sp_data = Rex.Execute(data)(0) End If End If fstdata = sp_data mid_cnt = Len(fstdata) get_data = Mid(data, mid_cnt + 1) n = InStr(get_data, "市") city = InStr(n + 1, get_data, "市") gun = InStr(get_data, "郡") If n <> 0 Then If city <> 0 And city < 6 Then Rex.Pattern = "^(八日市場|市川|市原|今市|四日市|八日市|廿日市)市" If Rex.test(get_data) Then sp_data = Rex.Execute(get_data)(0) mid_cnt = mid_cnt + Rex.Execute(get_data)(0).Length Else Rex.Pattern = "^余市郡" If Not Rex.test(get_data) Then Rex.Pattern = "市" If Rex.test(get_data) Then sp_data = Left(get_data, Rex.Execute(get_data)(0) _ .firstindex + 1) mid_cnt = mid_cnt + n End If End If End If ElseIf gun <> 0 And n > gun Then Rex.Pattern = "^(郡上|小郡|郡山|蒲郡|大和郡山)市" If Rex.test(get_data) Then sp_data = Rex.Execute(get_data)(0) mid_cnt = mid_cnt + Len(sp_data) End If ElseIf gun <> 0 And n < gun Then Rex.Pattern = "^高市郡" If Not Rex.test(get_data) Then Rex.Pattern = "市" If Rex.test(get_data) Then sp_data = Left(get_data, Rex.Execute(get_data)(0).firstindex + 1) mid_cnt = mid_cnt + n End If End If Else If n <> 1 Then sp_data = Mid(get_data, 1, n) mid_cnt = mid_cnt + n End If End If End If get_data = Mid(data, mid_cnt + 1) n = InStr(get_data, "区") If n > 1 And n < 6 Then Rex.Pattern = "([0-90-9]|一|二|三|四|五|六|七|八|九|十|公園|須岡|城西|八迫|由宇町.|太田中|太田北|金生字.)区" If Not Rex.test(get_data) Then Rex.Pattern = "(見市笠原町|部市生地|諸市東区)" If Not Rex.test(data) Then If Right(sp_data, 1) = "市" Then sp_data = Left(sp_data, Len(sp_data)) End If sp_data = sp_data & Mid(get_data, 1, n) mid_cnt = mid_cnt + n End If End If End If get_data = Mid(data, mid_cnt + 1, 69) Rex.Pattern = "(市|区)" If Not Rex.test(sp_data) Then Rex.Pattern = "^(.+郡)" If Rex.test(get_data) Then sp_data = Rex.Execute(get_data)(0) mid_cnt = mid_cnt + Rex.Execute(get_data)(0).Length scnddata = sp_data End If End If scnddata = sp_data srddata = Mid(data, mid_cnt + 1) End Sub Function kuwake(adrs As Range) With CreateObject("vbscript.regexp") .Pattern = "(¥W+)*市(.+区)" If .test(adrs) Then kuwake = .Replace(adrs, "$2") Else kuwake = "" End If End With End Function ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/200701/20070129190214.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97059 documents and 608315 words.

訪問者:カウンタValid HTML 4.01 Transitional