Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default New line of code.. same argument?

hi. i have a reallly long line of code - big if / or statement.. is there a
way to make it look nicer by bringing it down a row? thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default New line of code.. same argument?

I'm not sure what you are asking here. If you mean you want to move the
formula, as is, to a different cell... select the entire formula in the
Formula Bar, Cut it (Ctrl+X), then select the cell you want it in and Paste
it there (probably best to Paste it into the Formula Bar).

--
Rick (MVP - Excel)


"Derrick" wrote in message
...
hi. i have a reallly long line of code - big if / or statement.. is
there a
way to make it look nicer by bringing it down a row? thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default New line of code.. same argument?

not quite. in VBA... its like this:
if ab or cd or ef or gh then but A-h are longer cell references -
range("A"&target.Row)
so it goes way out to the right side.
can i do something whe
if Ab or
cd or
.... than
?

"Rick Rothstein" wrote:

I'm not sure what you are asking here. If you mean you want to move the
formula, as is, to a different cell... select the entire formula in the
Formula Bar, Cut it (Ctrl+X), then select the cell you want it in and Paste
it there (probably best to Paste it into the Formula Bar).

--
Rick (MVP - Excel)


"Derrick" wrote in message
...
hi. i have a reallly long line of code - big if / or statement.. is
there a
way to make it look nicer by bringing it down a row? thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default New line of code.. same argument?

VB has a Line Continuation character sequence you can use to do this. Just
put a space character followed by a underline character at any natural
breakpoint (that is, **not** in the middle of any keywords or text
constants) and then hit the Enter key to move to the next line and continue
your code there. For the sample statement you gave, it would look like
this...

If A B Or _
C D Or _
E F Or _
G H Then

Here is a link that explains it in a little more detail...

http://support.microsoft.com/kb/141513

--
Rick (MVP - Excel)


"Derrick" wrote in message
...
not quite. in VBA... its like this:
if ab or cd or ef or gh then but A-h are longer cell references -
range("A"&target.Row)
so it goes way out to the right side.
can i do something whe
if Ab or
cd or
... than
?

"Rick Rothstein" wrote:

I'm not sure what you are asking here. If you mean you want to move the
formula, as is, to a different cell... select the entire formula in the
Formula Bar, Cut it (Ctrl+X), then select the cell you want it in and
Paste
it there (probably best to Paste it into the Formula Bar).

--
Rick (MVP - Excel)


"Derrick" wrote in message
...
hi. i have a reallly long line of code - big if / or statement.. is
there a
way to make it look nicer by bringing it down a row? thanks.




Reply
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
Macro code to put series name next to individual line in line grap Otani Charts and Charting in Excel 3 February 23rd 10 07:24 PM
Code to read file in reverse fast line by line ChristopherL Excel Programming 3 October 1st 08 12:45 AM
Single line of code with line separator KarenF Excel Programming 4 August 19th 08 01:43 AM
Function (array argument, range argument, string argument) vba Witek[_2_] Excel Programming 3 April 24th 05 03:12 PM
argument in command line Mélanie H. Excel Programming 2 April 6th 05 12:40 PM


All times are GMT +1. The time now is 11:02 PM.

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"