Results 1 to 4 of 4

Code to check if field already contains data ...???

Threaded View

  1. #1
    Registered User
    Join Date
    11-15-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    19

    Smile Code to check if field already contains data ...???

    Evening All,

    Hope someone can help me with the code below.

    I am trying to change the code below so that it has the following rules :- if the sheet is empty then update with the new HEADER else if the 1st cell of the sheet is not empty (already contains a header value) then go to the next available blank row, and activate that cell.

    Below is my own attempt ( I'm just new to excel VBA) but it doesn't appear to work.....

    Any help is much appreciated.

    Thanks

    Public Sub InOut_Header()
    If Parking_Survey.surveySheet.Cells(1, "A") = "" Then
        Parking_Survey.surveySheet.Cells(1, "A").Value = "Registration"
        Parking_Survey.surveySheet.Cells(1, "B").Value = "Time"
        Parking_Survey.surveySheet.Cells(1, "C").Value = "Class"
        Parking_Survey.surveySheet.Cells(1, "D").Value = "Type"
    Else
        Dim Lastrow As Long
        Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
        End If
    End Sub
    Last edited by jeffreybrown; 09-02-2013 at 04:53 PM. Reason: As per Forum Rule #3, please use code tags…Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] vba code to be correct and check ,vba code to brig data for the same refreince
    By funtastic in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2012, 02:29 PM
  2. Replies: 2
    Last Post: 06-26-2012, 05:09 PM
  3. Check each row, if each proceeding row matches, take data and put in required field t
    By mattsmithnl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2011, 03:27 PM
  4. Replies: 1
    Last Post: 12-12-2008, 11:38 AM
  5. vba code to create a list from data in one field
    By short_n_curly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2007, 11:16 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1