PC Review


Reply
Thread Tools Rate Thread

Alpha Numeric’s bunch together

 
 
Rob
Guest
Posts: n/a
 
      1st Apr 2010
Hi,

When I type code the alpha numeric’s sometimes bunch together and the font
changes to red as in the case below. As in For i =1To2 and Nexti .

Sub CopyDemand()
Dim i As Integer
For i =1To2
Sheets("Demand").Select
ActiveCell.Offset(0, 2).Activate
ActiveCell.Copy
Sheets("Demand1").Activate
ActiveCell.Offset(0, 1).Activate
ActiveCell.PasteSpecial
Nexti
End Sub

Being a newbie at VBA programming I am sure there is a very simple
explanation for this.

Please will someone tell me what is happening.

Thank you.

 
Reply With Quote
 
 
 
 
OssieMac
Guest
Posts: n/a
 
      1st Apr 2010
Hi Rob,

Just insert some spaces between the words/numbers. VBA thinks it is one
string when the delimiter spaces are not included.

Example
For i = 1 To 2

With some code like endif VBA is smart enough to insert the spaces for you
and change it to End If but this does necessarily occur with all code.


--
Regards,

OssieMac


"Rob" wrote:

> Hi,
>
> When I type code the alpha numeric’s sometimes bunch together and the font
> changes to red as in the case below. As in For i =1To2 and Nexti .
>
> Sub CopyDemand()
> Dim i As Integer
> For i =1To2
> Sheets("Demand").Select
> ActiveCell.Offset(0, 2).Activate
> ActiveCell.Copy
> Sheets("Demand1").Activate
> ActiveCell.Offset(0, 1).Activate
> ActiveCell.PasteSpecial
> Nexti
> End Sub
>
> Being a newbie at VBA programming I am sure there is a very simple
> explanation for this.
>
> Please will someone tell me what is happening.
>
> Thank you.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I sort differeing types of data into different numerica va =?Utf-8?B?QmlnIFRyZXY=?= Microsoft Excel Misc 1 7th Apr 2007 05:14 PM
Change a letter grade to a numerica GPA =?Utf-8?B?Qm9nYXpldHRp?= Microsoft Excel Misc 3 13th Sep 2006 08:22 PM
Display only the alpha characters in a field w/both alpha&numeric. =?Utf-8?B?QXJibyBN?= Microsoft Access Queries 1 16th Dec 2004 08:19 AM
Combining Non-numerica data from multiple sources =?Utf-8?B?Sm9obiBKb3N0?= Microsoft Excel Programming 2 12th Nov 2004 09:35 PM
Can anyone suggest a good numerica encryption logarithm? =?Utf-8?B?RGF2ZQ==?= Microsoft Access 1 24th May 2004 03:24 AM


Features
 

Advertising
 

Newsgroups
 


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