Results 1 to 27 of 27

Thread: [RESOLVED] [Excel 2003] Excel 2003 coding VBA help needed

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    14

    Re: [Excel 2003] Excel 2003 coding VBA help needed

    Code:
    '~~> Search srchstring if it already exists
    Set aCell = ws.Cells.Find(What:=srchctring, LookIn:=xlFormulas, _
    LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False)
    
    If Not aCell Is Nothing Then
    '~~> If Found
    '~~>Your code here for copy and paste special
    Else
    '~~> If not found
    MsgBox "Not Found"
    End If
    I've been looking at this code, but the find srchstring and the rest of the arguments don't make sense to me

    do i have to hard-code each thing i would ever want to search for? or how can i use the value input into a textbox, like the ones I just learned in the above posts, to be input into the find string.

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [Excel 2003] Excel 2003 coding VBA help needed

    Here is an example...

    Hope it helps...
    Attached Files Attached Files
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    14

    Re: [Excel 2003] Excel 2003 coding VBA help needed

    I kind of understand, but the code in the macro doesn't quite click for me. the search & delete button is exactly what I want, but is there a way code-wise to instead of hard-code a value to search for, .. instead popup a simpe message box with a text box to imput what you want to search for and delete?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width