LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default IF..Then..ELSE.. ELSEIF

Hi NG,

I have to make a If then else statement.

I have 3 cells that may contain something like this (text):

exampel1:
Cell1("B47"): peter
Cell2("B48"): Blank
Cell3("B49"): Blank

exampel2:
Cell1("B47"): thomas
Cell2("B48"): michael
Cell3("B49"): Blank

exampel3:
Cell1("B47"): thomas
Cell2("B48"): peter
Cell3("B49"): michell

And here is what i want to happen, the cells with names should be copied to
another sheed like this:

exampel1: peter

exampel2: thomas / michael

exampel3: thomas / peter / michell

And here is one of me solutions that wont work:

If Worksheets(2).Range("B48") = "Blank" Then
bk.Worksheets(2).Range("D6").Value = _
Format(Range("B47").Value) ' kopier 1 folietyper
End If
If Worksheets(2).Range("B49") = "Blank" Then
bk.Worksheets(2).Range("D6").Value = _
Format(Range("B47").Value) & " / " & Format(Range("B48").Value) '
indsætter 2 folietyper
Else: bk.Worksheets(2).Range("D6"). _
Value = Format(Range("B47").Value) & " / " & Format(Range("B48").Value) & "
/ " & Format(Range("B49").Value) ' kopier alle 3 folietyper
End If

When it only should copy B47 in exampel1 it copies B47 and B48.

AHA.

Ole_


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Elseif? ibrokit Excel Worksheet Functions 5 November 25th 08 04:28 PM
if elseif flow23 Excel Discussion (Misc queries) 0 November 14th 05 02:09 PM
If, ElseIf mast Excel Programming 1 January 26th 05 12:11 PM
ElseIf tom1646 Excel Programming 4 October 19th 04 02:09 PM
If...Elseif...End If javab98 Excel Programming 2 July 19th 04 07:23 PM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"