No.2ベストアンサー
- 回答日時:
こんにちは!
No.1さんが回答されている方法そのままです。
Sub Sample1()
Dim FoundCell As Range, FirstCell As Range
Dim myRng As Range
With ActiveSheet
Set FoundCell = .Cells.Find(what:="http", LookIn:=xlValues, lookat:=xlPart)
If Not FoundCell Is Nothing Then
Set FirstCell = FoundCell
Set myRng = FoundCell
Do
Set FoundCell = .Cells.FindNext(after:=FoundCell)
If FoundCell.Address = FirstCell.Address Then Exit Do
Set myRng = Union(myRng, FoundCell)
Loop
If Not myRng Is Nothing Then
myRng.EntireColumn.Select '//★//
End If
End If
End With
End Sub
※ 列選択でやめています。
間違いがなければ「★」の行を
>myRng.EntireColumn.Delete
に変更してください。m(_ _)m
No.3
- 回答日時:
No1です
>できませんでした
「何もしていない」から「あと一歩のところ」まで、ピンキリの意味が考えられるので、反応のしようがありません。
コピペできるものが欲しいのなら、すでにNo2様が回答なさってくださっています。
とりあえず、No1の回答の意味するままを示しておくなら(必要最低限)
Sub Sample()
Dim r As Range
Set r = Cells.Find(What:="http", LookIn:=xlValues, LookAt:=xlPart)
Do While Not r Is Nothing
r.EntireColumn.Delete
Set r = Cells.FindNext()
Loop
End Sub
No.1
- 回答日時:
こんにちは
>どうすれば良いですか?
検索して、該当するセルの列を削除すれば宜しいかと。
検索方法にもいろいろあると思いますが、例えば、Findを用いるなら
Set r = Cells.Find(What:="http", LookIn:=xlValues, LookAt:=xlPart)
みたいな感じで、見つからなくなるまでループすれば宜しいかと。
Findメソッドの使い方や説明は以下をご参照ください。
https://docs.microsoft.com/ja-jp/office/vba/api/ …
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・人生のプチ美学を教えてください!!
- ・10秒目をつむったら…
- ・あなたの習慣について教えてください!!
- ・牛、豚、鶏、どれか一つ食べられなくなるとしたら?
- ・【大喜利】【投稿~9/18】 おとぎ話『桃太郎』の知られざるエピソード
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
エクセルの質問です。 F列からL...
-
作成した数式を値として表示し...
-
エクセルの文字が途中から消える
-
条件付き書式設定で罫線を引き...
-
Excel関数について教えてくださ...
-
Excelの警告について
-
Excel関数について教えてくださ...
-
ワークシートに出現したこの画...
-
エクセルのセル内に分数などの...
-
タイムスタンプとテキストから...
-
EXCELの散布図で日付が1900年に...
-
エクセルでファイルの最終更新...
-
シートの情報を別のシートへま...
-
マクロの処理が遅くなった
-
エクセルの数式バーのフォント...
-
エクセルの「条件付き書式」を...
-
エクセル日付 文字列の関数がエ...
-
Excelでの文字色
-
Excelの数字の前に入っている空...
-
Excelについて教えてください。...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
Webクエリで取り込んだ文字列の...
-
にんにくの臭いはどのくらい続...
-
クレジットカード情報入力ペー...
-
【至急】SEO業者は本当にいいの...
-
ネットショッピングHPを検索上...
-
CATVの流合雑音対策について
-
SEO対策で質問!!
-
PDCAとSDCAについて
-
ヤフーカテゴリ登録について教...
-
ニガウリ茶の作り方を教えてく...
-
ブラウザを使わずコマンドプロ...
-
httpとftpの使い分けについて
-
地方銀行同士の合併による、具...
-
ネット ID の暗証番号の入力...
-
Kierin near Tokyo?
-
ページランクをあげるには?
-
SEO対策について
-
http ://homepage3.nifty.com/p...
-
ポータルサイト有料登録だけど...
-
今の時期 効果的にサイトを広...
おすすめ情報