![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 6
|
I have a text file that I am imorting into a spreadsheet.
Dim Plate As Integer Plate = Range("C1") Occasionally the value I'm looking for ends up 2 columns to the left. If this happens how can I apply a conditional statement that resets the range to("A1") |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
If when this happens, there is nothing in C1 then use the following code:
Dim Plate As Integer If Range("c1").Value = "" Then Plate = Range("a1").Value Else: Plate = Range("c1") End If Hope this helps. Kind regards, Al. |
|
|
|
|
|
#3 | |
|
New Member
Join Date: Feb 2002
Posts: 6
|
Al,
It works like a charm. Thanks so much for your help, it pulled me from a sticky situation. Thanks Again ToddM Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|